Allow disabling of auto-complete in 1.13 via disable-1_13-auto-complete in config #891

This commit is contained in:
Myles 2018-09-01 07:53:36 +01:00
parent 84aaec6bff
commit 527b5e6f99
6 changed files with 30 additions and 2 deletions

View File

@ -209,4 +209,9 @@ public class BukkitConfigAPI extends Config implements ViaVersionConfig {
public boolean isSuppress1_13ConversionErrors() {
return getBoolean("suppress-1_13-conversion-errors", false);
}
@Override
public boolean isDisable1_13AutoComplete() {
return getBoolean("disable-1_13-auto-complete", false);
}
}

View File

@ -262,4 +262,9 @@ public class BungeeConfigAPI extends Config implements ViaVersionConfig {
public boolean isSuppress1_13ConversionErrors() {
return getBoolean("suppress-1_13-conversion-errors", false);
}
@Override
public boolean isDisable1_13AutoComplete() {
return getBoolean("disable-1_13-auto-complete", false);
}
}

View File

@ -216,14 +216,14 @@ public interface ViaVersionConfig {
* @return True if enabled
*/
boolean is1_13TeamColourFix();
/**
* Should we fix shift quick move action for 1.12 clients
*
* @return True if enabled
*/
boolean is1_12QuickMoveActionFix();
/**
* Get the blocked protocols
*
@ -252,4 +252,11 @@ public interface ViaVersionConfig {
* @return True if enabled
*/
boolean isSuppress1_13ConversionErrors();
/**
* Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13)
*
* @return True if enabled
*/
boolean isDisable1_13AutoComplete();
}

View File

@ -536,6 +536,10 @@ public class Protocol1_13To1_12_2 extends Protocol {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
// Disable auto-complete if configured
if (Via.getConfig().isDisable1_13AutoComplete()) {
wrapper.cancel();
}
int tid = wrapper.read(Type.VAR_INT);
// Save transaction id
wrapper.user().get(TabCompleteTracker.class).setTransactionId(tid);

View File

@ -90,6 +90,8 @@ quick-move-action-fix: false
team-colour-fix: true
# We warn when there's a error converting from pre-1.13 to 1.13, should we suppress these? (Only suggested if spamming)
suppress-1_13-conversion-errors: false
# 1.13 introduced new auto complete which can trigger "Kicked for spamming" for servers older than 1.13, the following option will disable it completely.
disable-1_13-auto-complete: false
#
#----------------------------------------------------------#
# 1.9 & 1.10 CLIENTS ON 1.8 SERVERS OPTIONS #

View File

@ -215,4 +215,9 @@ public class SpongeConfigAPI extends Config implements ViaVersionConfig {
public boolean isSuppress1_13ConversionErrors() {
return getBoolean("suppress-1_13-conversion-errors", false);
}
@Override
public boolean isDisable1_13AutoComplete() {
return getBoolean("disable-1_13-auto-complete", false);
}
}