3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-31 11:28:03 +02:00

Move long plugin channel name check to a config option

Dieser Commit ist enthalten in:
KennyTV 2020-07-19 17:30:03 +02:00
Ursprung 5047aaff0c
Commit 647230a996
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 20 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -54,6 +54,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
private boolean fullBlockLightFix;
private boolean healthNaNFix;
private boolean instantRespawn;
private boolean ignoreLongChannelNames;
protected AbstractViaConfig(File configFile) {
super(configFile);
@ -111,6 +112,7 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
fullBlockLightFix = getBoolean("fix-non-full-blocklight", false);
healthNaNFix = getBoolean("fix-1_14-health-nan", true);
instantRespawn = getBoolean("use-1_15-instant-respawn", false);
ignoreLongChannelNames = getBoolean("ignore-long-1_16-channel-names", true);
}
@Override
@ -363,4 +365,9 @@ public abstract class AbstractViaConfig extends Config implements ViaVersionConf
public boolean is1_15InstantRespawn() {
return instantRespawn;
}
@Override
public boolean isIgnoreLong1_16ChannelMessages() {
return ignoreLongChannelNames;
}
}

Datei anzeigen

@ -346,9 +346,16 @@ public interface ViaVersionConfig {
boolean is1_14HealthNaNFix();
/**
* Should 1.15 clients respawn instantly / without showing the death screen
* Should 1.15 clients respawn instantly / without showing the death screen.
*
* @return True if enabled
*/
boolean is1_15InstantRespawn();
/**
* Ignores incoming plugin channel messages of 1.16 clients with channel names longer than 32 charatcers.
*
* @return True if enabled
*/
boolean isIgnoreLong1_16ChannelMessages();
}

Datei anzeigen

@ -143,8 +143,7 @@ public class Protocol1_16To1_15_2 extends Protocol<ClientboundPackets1_15, Clien
}
});
// Spigot has the arbitrary limit of 32 in 1.15, upped to 64 in 1.16
if (isSpigot()) {
if (Via.getConfig().isIgnoreLong1_16ChannelMessages()) {
registerIncoming(ServerboundPackets1_16.PLUGIN_MESSAGE, new PacketRemapper() {
@Override
public void registerMap() {
@ -250,13 +249,4 @@ public class Protocol1_16To1_15_2 extends Protocol<ClientboundPackets1_15, Clien
userConnection.put(new ClientWorld(userConnection));
}
}
private boolean isSpigot() {
try {
Class.forName("org.spigotmc.SpigotConfig");
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
}

Datei anzeigen

@ -147,6 +147,10 @@ flowerstem-when-block-above: false
# Vines that are not connected to blocks will be mapped to air, else 1.13+ would still be able to climb up on them.
vine-climb-fix: false
#
# Ignores incoming plugin channel messages of 1.16 clients with channel names longer than 32 charatcers.
# CraftBukkit had this limit hardcoded until 1.16, so we have to assume any server/proxy might have this arbitrary check present.
ignore-long-1_16-channel-names: true
#
#----------------------------------------------------------#
# 1.9+ CLIENTS ON 1.8 SERVERS OPTIONS #
#----------------------------------------------------------#