1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-27 18:59:17 +00:00

Renaming to PluginSpecific

This commit is contained in:
Camotoy
2024-09-10 18:36:23 -04:00
parent a6c21b1f00
commit b71927840b
4 changed files with 11 additions and 7 deletions

View File

@@ -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!")

View File

@@ -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, Object> platformTypeSpecific(boolean thisConfigPlugin) {
private static Processor.Factory<PluginSpecific, Object> integrationSpecific(boolean thisConfigPlugin) {
return (data, fieldType) -> (value, destination) -> {
if (data.forPlugin() != thisConfigPlugin) {
//noinspection DataFlowIssue

View File

@@ -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);

View File

@@ -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;
}