mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
logic issue fix
This commit is contained in:
parent
5bdd2f9b4c
commit
dd2f3204c3
2 changed files with 6 additions and 10 deletions
|
|
@ -5,22 +5,20 @@ import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
|||
|
||||
import static xyz.alexcrea.cuanvil.update.UpdateUtils.addAbsentToList;
|
||||
|
||||
// This is a temporary class that aim to handle 1.21 update.
|
||||
// It will be replaced by a better system later.
|
||||
public class Update_1_21 {
|
||||
|
||||
private static final Version V1_21 = new Version(1, 21);
|
||||
|
||||
public static void handleUpdate(Version current){
|
||||
// Test if we are running in 1.21.1
|
||||
if(V1_21.greaterEqual(current))
|
||||
// Test if we are running in 1.21 or better
|
||||
if(V1_21.greaterThan(current))
|
||||
return;
|
||||
|
||||
// if version path is not null then check if its it's before 1.21
|
||||
String oldVersion = ConfigHolder.DEFAULT_CONFIG.getConfig().getString(UpdateUtils.MINECRAFT_VERSION_PATH);
|
||||
if(oldVersion != null){
|
||||
var version = Version.fromString(oldVersion);
|
||||
if(V1_21.greaterEqual(version)) return;
|
||||
if(V1_21.lesserEqual(version)) return;
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
|
|
|
|||
|
|
@ -5,22 +5,20 @@ import xyz.alexcrea.cuanvil.config.ConfigHolder;
|
|||
|
||||
import static xyz.alexcrea.cuanvil.update.UpdateUtils.addAbsentToList;
|
||||
|
||||
// This is a temporary class that aim to handle 1.21 update.
|
||||
// It will be replaced by a better system later.
|
||||
public class Update_1_21_9 {
|
||||
|
||||
private static final Version V1_21_9 = new Version(1, 21, 9);
|
||||
|
||||
public static void handleUpdate(Version current){
|
||||
// Test if we are running in 1.21.1.9
|
||||
if(V1_21_9.greaterEqual(current))
|
||||
// Test if we are running in 1.21.9 or better
|
||||
if(V1_21_9.greaterThan(current))
|
||||
return;
|
||||
|
||||
// if version path is not null then check if its it's before 1.21.9
|
||||
String oldVersion = ConfigHolder.DEFAULT_CONFIG.getConfig().getString(UpdateUtils.MINECRAFT_VERSION_PATH);
|
||||
if(oldVersion != null){
|
||||
var version = Version.fromString(oldVersion);
|
||||
if(V1_21_9.greaterEqual(version)) return;
|
||||
if(V1_21_9.lesserEqual(version)) return;
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue