Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-08 09:10:10 +01:00
Add config option to suppress emulation warnings (#751)
Dieser Commit ist enthalten in:
Ursprung
f9890db702
Commit
6e75026681
@ -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");
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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.");
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren