Various code cleanup.

This commit is contained in:
Marc Baloup 2023-04-10 19:17:18 +02:00
parent ba896e689a
commit ff954a3903
5 changed files with 7 additions and 7 deletions

View File

@ -336,7 +336,7 @@ public interface SuggestionsSupplier<S> {
/**
* List of all possible duration unit symbols for suggestions.
*/
public static final List<String> DURATION_SUFFIXES = List.of("y", "mo", "w", "d", "h", "m", "s");
List<String> DURATION_SUFFIXES = List.of("y", "mo", "w", "d", "h", "m", "s");
private static void scanAndRemovePastSuffixes(List<String> suffixes, String foundSuffix) {

View File

@ -310,9 +310,7 @@ public abstract class BackupProcess implements Comparable<BackupProcess>, Runnab
return false;
if (!isDirty())
return false;
if (getNext() > System.currentTimeMillis())
return false;
return true;
return getNext() <= System.currentTimeMillis();
}

View File

@ -12,8 +12,8 @@ import static fr.pandacube.lib.util.ThrowableUtil.wrapReflectEx;
@ConcreteWrapper(GameVersion.__concrete.class)
public interface GameVersion extends ReflectWrapperI {
public static final ReflectClass<?> REFLECT = wrapEx(() -> Reflect.ofClass("com.mojang.bridge.game.GameVersion"));
public static final ReflectMethod<?> getWorldVersion = wrapEx(() -> REFLECT.method("getWorldVersion"));
ReflectClass<?> REFLECT = wrapEx(() -> Reflect.ofClass("com.mojang.bridge.game.GameVersion"));
ReflectMethod<?> getWorldVersion = wrapEx(() -> REFLECT.method("getWorldVersion"));
default int getWorldVersion() {
return (int) wrapReflectEx(() -> getWorldVersion.invoke(__getRuntimeInstance()));

View File

@ -20,10 +20,12 @@ public class CollectionTag extends ReflectWrapperTyped<AbstractList<?>> implemen
return wrap(__getRuntimeInstance().get(i), Tag.class);
}
@SuppressWarnings("unchecked")
public Tag set(int i, Tag t) {
return wrap(((AbstractList<Object>)__getRuntimeInstance()).set(i, unwrap(t)), Tag.class);
}
@SuppressWarnings("unchecked")
public void add(int i, Tag t) {
((AbstractList<Object>)__getRuntimeInstance()).add(i, unwrap(t));
}

View File

@ -179,7 +179,7 @@ public class TimeUtil {
/**
* Seconds precision for relative display.
*/
SECONDS;
SECONDS
}
/**