Include new bedrock-at-0 config option in world height warning (#815)

This commit is contained in:
EnZaXD 2024-07-09 18:26:49 +02:00 committed by GitHub
parent e56920c7b1
commit d7e7992ca4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ import com.viaversion.viaversion.util.TagUtil;
public final class EntityPacketRewriter1_17 extends EntityRewriter<ClientboundPackets1_17, Protocol1_17To1_16_4> {
private boolean warned;
private boolean warned = ViaBackwards.getConfig().bedrockAtY0() || ViaBackwards.getConfig().suppressEmulationWarnings();
public EntityPacketRewriter1_17(Protocol1_17To1_16_4 protocol) {
super(protocol);
@ -210,8 +210,8 @@ 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 && !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");
if (warn && !warned) {
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. You can enable the `bedrock-at-y-0` config option to replace the air with a bedrock layer.");
warned = true;
}