mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Move long plugin channel name check to a config option
This commit is contained in:
parent
5047aaff0c
commit
647230a996
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 #
|
||||
#----------------------------------------------------------#
|
||||
|
Loading…
Reference in New Issue
Block a user