From b71927840b5c025c1c8fec01b4e47430b1b5f7bc Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:36:23 -0400 Subject: [PATCH] Renaming to PluginSpecific --- .../org/geysermc/geyser/configuration/AdvancedConfig.java | 4 ++-- .../org/geysermc/geyser/configuration/ConfigLoader.java | 4 ++-- .../org/geysermc/geyser/configuration/GeyserConfig.java | 4 ++-- .../{PlatformTypeSpecific.java => PluginSpecific.java} | 6 +++++- 4 files changed, 11 insertions(+), 7 deletions(-) rename core/src/main/java/org/geysermc/geyser/configuration/{PlatformTypeSpecific.java => PluginSpecific.java} (91%) diff --git a/core/src/main/java/org/geysermc/geyser/configuration/AdvancedConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/AdvancedConfig.java index 1d64f3c6a..60d278146 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/AdvancedConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/AdvancedConfig.java @@ -87,7 +87,7 @@ public interface AdvancedConfig { If disabled, expect performance decrease and latency increase """) @DefaultBoolean(true) - @PlatformTypeSpecific + @PluginSpecific boolean useDirectConnection(); @Comment(""" @@ -96,7 +96,7 @@ public interface AdvancedConfig { This requires use-direct-connection to be true. """) @DefaultBoolean(true) - @PlatformTypeSpecific + @PluginSpecific boolean disableCompression(); @Comment("Do not touch!") diff --git a/core/src/main/java/org/geysermc/geyser/configuration/ConfigLoader.java b/core/src/main/java/org/geysermc/geyser/configuration/ConfigLoader.java index dcda2fe0b..634d827cc 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/ConfigLoader.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/ConfigLoader.java @@ -294,7 +294,7 @@ public final class ConfigLoader { .nodeStyle(NodeStyle.BLOCK) .defaultOptions(options -> InterfaceDefaultOptions.addTo(options, builder -> builder.addProcessor(ExcludePlatform.class, excludePlatform(bootstrap.platformType().platformName())) - .addProcessor(PlatformTypeSpecific.class, platformTypeSpecific(bootstrap.platformType() != PlatformType.STANDALONE))) + .addProcessor(PluginSpecific.class, integrationSpecific(bootstrap.platformType() != PlatformType.STANDALONE))) .shouldCopyDefaults(false) // If we use ConfigurationNode#get(type, default), do not write the default back to the node. .header(header) .serializers(builder -> builder.register(new LowercaseEnumSerializer()))) @@ -313,7 +313,7 @@ public final class ConfigLoader { }; } - private static Processor.Factory platformTypeSpecific(boolean thisConfigPlugin) { + private static Processor.Factory integrationSpecific(boolean thisConfigPlugin) { return (data, fieldType) -> (value, destination) -> { if (data.forPlugin() != thisConfigPlugin) { //noinspection DataFlowIssue diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java index e055ab9d2..16380e21b 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java @@ -87,7 +87,7 @@ public interface GeyserConfig { Use server API methods to determine the Java server's MOTD and ping passthrough. There is no need to disable this unless your MOTD or player count does not appear properly.""") @DefaultBoolean(true) - @PlatformTypeSpecific + @PluginSpecific boolean integratedPingPassthrough(); @Comment("How often to ping the Java server to refresh MOTD and player count, in seconds.") @@ -219,7 +219,7 @@ public interface GeyserConfig { Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock. This option makes the Bedrock port the same as the Java port every time you start the server.""") @DefaultBoolean - @PlatformTypeSpecific + @PluginSpecific boolean cloneRemotePort(); void address(String address); diff --git a/core/src/main/java/org/geysermc/geyser/configuration/PlatformTypeSpecific.java b/core/src/main/java/org/geysermc/geyser/configuration/PluginSpecific.java similarity index 91% rename from core/src/main/java/org/geysermc/geyser/configuration/PlatformTypeSpecific.java rename to core/src/main/java/org/geysermc/geyser/configuration/PluginSpecific.java index a5eb40447..91871687a 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/PlatformTypeSpecific.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/PluginSpecific.java @@ -30,8 +30,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/** + * Add to a config value to indicate this field is only for plugin versions of Geyser, + * or vice-versa. + */ @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) -public @interface PlatformTypeSpecific { +public @interface PluginSpecific { boolean forPlugin() default true; }