From 248da118a92413dcfca894a8d669c805410a9547 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Thu, 27 Jun 2024 09:56:50 +0200 Subject: [PATCH] Move bukkit-only settings into BukkitViaConfig (#3985) --- .../bukkit/platform/BukkitViaConfig.java | 21 +++++++++++++++++++ .../configuration/AbstractViaConfig.java | 12 +++-------- .../velocity/platform/VelocityViaConfig.java | 10 --------- 3 files changed, 24 insertions(+), 19 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 38c589721..ed960c4b4 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 @@ -30,6 +30,9 @@ public class BukkitViaConfig extends AbstractViaConfig { private String blockConnectionMethod; private boolean armorToggleFix; private boolean registerUserConnectionOnJoin; + private boolean useNewDeathMessages; + private boolean itemCache; + private boolean nmsPlayerTicking; public BukkitViaConfig(final File folder, final Logger logger) { super(new File(folder, "config.yml"), logger); @@ -44,6 +47,9 @@ public class BukkitViaConfig extends AbstractViaConfig { hitboxFix1_14 = getBoolean("change-1_14-hitbox", false); blockConnectionMethod = getString("blockconnection-method", "packet"); armorToggleFix = getBoolean("armor-toggle-fix", true); + useNewDeathMessages = getBoolean("use-new-deathmessages", true); + itemCache = getBoolean("item-cache", true); + nmsPlayerTicking = getBoolean("nms-player-ticking", true); } @Override @@ -80,6 +86,21 @@ public class BukkitViaConfig extends AbstractViaConfig { return armorToggleFix; } + @Override + public boolean isShowNewDeathMessages() { + return useNewDeathMessages; + } + + @Override + public boolean isItemCache() { + return itemCache; + } + + @Override + public boolean isNMSPlayerTicking() { + return nmsPlayerTicking; + } + @Override public List getUnsupportedOptions() { 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 555e3e9a4..9ed664068 100644 --- a/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java +++ b/common/src/main/java/com/viaversion/viaversion/configuration/AbstractViaConfig.java @@ -45,7 +45,6 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf private boolean checkForUpdates; private boolean preventCollision; private boolean useNewEffectIndicator; - private boolean useNewDeathmessages; private boolean suppressMetadataErrors; private boolean shieldBlocking; private boolean noDelayShieldBlocking; @@ -63,8 +62,6 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf private String maxPPSWarningsKickMessage; private boolean sendSupportedVersions; private boolean simulatePlayerTick; - private boolean itemCache; - private boolean nmsPlayerTicking; private boolean replacePistons; private int pistonReplacementId; private boolean chunkBorderFix; @@ -112,7 +109,6 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf checkForUpdates = getBoolean("check-for-updates", true); preventCollision = getBoolean("prevent-collision", true); useNewEffectIndicator = getBoolean("use-new-effect-indicator", true); - useNewDeathmessages = getBoolean("use-new-deathmessages", true); suppressMetadataErrors = getBoolean("suppress-metadata-errors", false); shieldBlocking = getBoolean("shield-blocking", true); noDelayShieldBlocking = getBoolean("no-delay-shield-blocking", false); @@ -130,8 +126,6 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf maxPPSWarningsKickMessage = getString("tracking-max-kick-msg", "You are sending too many packets, :("); sendSupportedVersions = getBoolean("send-supported-versions", false); simulatePlayerTick = getBoolean("simulate-pt", true); - itemCache = getBoolean("item-cache", true); - nmsPlayerTicking = getBoolean("nms-player-ticking", true); replacePistons = getBoolean("replace-pistons", false); pistonReplacementId = getInt("replacement-piston-id", 0); chunkBorderFix = getBoolean("chunk-border-fix", false); @@ -260,7 +254,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf @Override public boolean isShowNewDeathMessages() { - return useNewDeathmessages; + return false; } @Override @@ -350,12 +344,12 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf @Override public boolean isItemCache() { - return itemCache; + return false; } @Override public boolean isNMSPlayerTicking() { - return nmsPlayerTicking; + return false; } @Override 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 3702fc17a..f426dca1a 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 @@ -86,16 +86,6 @@ public class VelocityViaConfig extends AbstractViaConfig { return BUKKIT_ONLY_OPTIONS; } - @Override - public boolean isItemCache() { - return false; - } - - @Override - public boolean isNMSPlayerTicking() { - return false; - } - /** * What is the interval for checking servers via ping * -1 for disabled