3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-25 15:50:12 +01:00

Add config option to suppress emulation warnings (#751)

Dieser Commit ist enthalten in:
EnZaXD 2024-05-19 09:27:22 +02:00 committet von GitHub
Ursprung f9890db702
Commit 6e75026681
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
5 geänderte Dateien mit 20 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -34,6 +34,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
private boolean alwaysShowOriginalMobName;
private boolean fix1_13FormattedInventoryTitles;
private boolean handlePingsAsInvAcknowledgements;
private boolean suppressEmulationWarnings;
public ViaBackwardsConfig(File configFile, Logger logger) {
super(configFile, logger);
@ -52,6 +53,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
fix1_13FormattedInventoryTitles = getBoolean("fix-formatted-inventory-titles", true);
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
suppressEmulationWarnings = getBoolean("suppress-emulation-warnings", false);
}
@Override
@ -84,6 +86,11 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
return handlePingsAsInvAcknowledgements || Boolean.getBoolean("com.viaversion.handlePingsAsInvAcknowledgements");
}
@Override
public boolean suppressEmulationWarnings() {
return suppressEmulationWarnings;
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viabackwards/config.yml");

Datei anzeigen

@ -63,4 +63,11 @@ public interface ViaBackwardsConfig extends Config {
* @return true if enabled
*/
boolean handlePingsAsInvAcknowledgements();
/**
* Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
*
* @return true if enabled
*/
boolean suppressEmulationWarnings();
}

Datei anzeigen

@ -83,7 +83,7 @@ public class EntityPacketRewriter1_16_2 extends EntityRewriter<ClientboundPacket
NumberTag id = biome.getNumberTag("id");
biomeStorage.addBiome(name.getValue(), id.asInt());
}
} else if (!warned) {
} else if (!warned && !ViaBackwards.getConfig().suppressEmulationWarnings()) {
warned = true;
protocol.getLogger().warning("1.16 and 1.16.1 clients are only partially supported and may have wrong biomes displayed.");
}

Datei anzeigen

@ -206,7 +206,7 @@ public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPa
NumberTag height = tag.getNumberTag("height");
NumberTag logicalHeight = tag.getNumberTag("logical_height");
if (minY.asInt() != 0 || height.asInt() > 256 || logicalHeight.asInt() > 256) {
if (warn && !warned) {
if (warn && !warned && !ViaBackwards.getConfig().suppressEmulationWarnings()) {
protocol.getLogger().warning("Increased world height is NOT SUPPORTED for 1.16 players and below. They will see a void below y 0 and above 256");
warned = true;
}

Datei anzeigen

@ -19,4 +19,7 @@ fix-formatted-inventory-titles: true
#
# Sends inventory acknowledgement packets to act as a replacement for ping packets for sub 1.17 clients.
# This only takes effect for ids in the short range. Useful for anticheat compatibility.
handle-pings-as-inv-acknowledgements: false
handle-pings-as-inv-acknowledgements: false
#
# Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
suppress-emulation-warnings: false