From 9b776b5321b0f98bd5ccbda9a692770f0c52e85f Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:26:59 +0200 Subject: [PATCH] Fixed remote config being reset everytime when accessed on Geyser-ViaProxy (#4722) --- .../viaproxy/GeyserViaProxyConfiguration.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java b/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java index 1b82e9f67..afc46fa6a 100644 --- a/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java +++ b/bootstrap/viaproxy/src/main/java/org/geysermc/geyser/platform/viaproxy/GeyserViaProxyConfiguration.java @@ -34,8 +34,16 @@ import java.io.File; import java.nio.file.Path; @JsonIgnoreProperties(ignoreUnknown = true) +@SuppressWarnings("FieldMayBeFinal") // Jackson requires that the fields are not final public class GeyserViaProxyConfiguration extends GeyserJacksonConfiguration { + private RemoteConfiguration remote = new RemoteConfiguration() { + @Override + public boolean isForwardHost() { + return super.isForwardHost() || !ViaProxy.getConfig().getWildcardDomainHandling().equals(ViaProxyConfig.WildcardDomainHandling.NONE); + } + }; + @Override public Path getFloodgateKeyPath() { return new File(GeyserViaProxyPlugin.ROOT_FOLDER, this.getFloodgateKeyFile()).toPath(); @@ -53,14 +61,7 @@ public class GeyserViaProxyConfiguration extends GeyserJacksonConfiguration { @Override public RemoteConfiguration getRemote() { - return new RemoteConfiguration() { - - @Override - public boolean isForwardHost() { - return super.isForwardHost() || !ViaProxy.getConfig().getWildcardDomainHandling().equals(ViaProxyConfig.WildcardDomainHandling.NONE); - } - - }; + return this.remote; } }