From a9878821326de96d76b6c13718ceb8d68614cf82 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Thu, 27 Jun 2024 09:54:44 +0200 Subject: [PATCH] Rework unsupported config options in AbstractViaConfig (#3986) --- .../viaversion/bukkit/platform/BukkitViaConfig.java | 4 +--- .../viaversion/configuration/AbstractViaConfig.java | 6 ++++++ .../viaversion/velocity/platform/VelocityViaConfig.java | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaConfig.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaConfig.java index 593fc28c7..38c589721 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaConfig.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/BukkitViaConfig.java @@ -19,13 +19,11 @@ package com.viaversion.viaversion.bukkit.platform; import com.viaversion.viaversion.configuration.AbstractViaConfig; import java.io.File; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.logging.Logger; public class BukkitViaConfig extends AbstractViaConfig { - private static final List UNSUPPORTED = Arrays.asList("velocity-ping-interval", "velocity-ping-save", "velocity-servers"); private boolean quickMoveActionFix; private boolean hitboxFix1_9; private boolean hitboxFix1_14; @@ -84,6 +82,6 @@ public class BukkitViaConfig extends AbstractViaConfig { @Override public List getUnsupportedOptions() { - return UNSUPPORTED; + return VELOCITY_ONLY_OPTIONS; } } diff --git a/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java b/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java index 7f0cfd9d6..555e3e9a4 100644 --- a/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java +++ b/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java @@ -26,6 +26,7 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.protocol.BlockedProtocolVersionsImpl; import com.viaversion.viaversion.util.Config; import java.io.File; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,6 +36,11 @@ import it.unimi.dsi.fastutil.objects.ObjectSet; import org.checkerframework.checker.nullness.qual.Nullable; public abstract class AbstractViaConfig extends Config implements ViaVersionConfig { + public static final List BUKKIT_ONLY_OPTIONS = Arrays.asList("register-userconnections-on-join", "quick-move-action-fix", + "change-1_9-hitbox", "change-1_14-hitbox", "blockconnection-method", "armor-toggle-fix", "use-new-deathmessages", + "item-cache", "nms-player-ticking"); + + public static final List VELOCITY_ONLY_OPTIONS = Arrays.asList("velocity-ping-interval", "velocity-ping-save", "velocity-servers"); private boolean checkForUpdates; private boolean preventCollision; diff --git a/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaConfig.java b/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaConfig.java index b92189931..3702fc17a 100644 --- a/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaConfig.java +++ b/velocity/src/main/java/com/viaversion/viaversion/velocity/platform/VelocityViaConfig.java @@ -20,7 +20,6 @@ package com.viaversion.viaversion.velocity.platform; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.configuration.AbstractViaConfig; import java.io.File; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -28,7 +27,6 @@ import java.util.Map; import java.util.logging.Logger; public class VelocityViaConfig extends AbstractViaConfig { - private static final List UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "quick-move-action-fix", "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox"); private int velocityPingInterval; private boolean velocityPingSave; private Map velocityServerProtocols; @@ -85,7 +83,7 @@ public class VelocityViaConfig extends AbstractViaConfig { @Override public List getUnsupportedOptions() { - return UNSUPPORTED; + return BUKKIT_ONLY_OPTIONS; } @Override