3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Renaming to PluginSpecific

Dieser Commit ist enthalten in:
Camotoy 2024-09-10 18:36:23 -04:00
Ursprung a6c21b1f00
Commit b71927840b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
4 geänderte Dateien mit 11 neuen und 7 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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