From 8e593a55a3505a583f72a05b2658bb88842aef39 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 16 Jul 2021 20:06:09 -0400 Subject: [PATCH] Adjust language strings for new options --- README.md | 2 -- .../geysermc/connector/utils/ChunkUtils.java | 28 +++++++++++++++---- connector/src/main/resources/config.yml | 4 +-- connector/src/main/resources/languages | 2 +- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9da7caf5d..244a816aa 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,6 @@ Take a look [here](https://github.com/GeyserMC/Geyser/wiki/Setup) for how to set - Some Entity Flags - Structure block UI -Extended height features can be "supported", but require additional work. - ## What can't be fixed There are a few things Geyser is unable to support due to various differences between Minecraft Bedrock and Java. For a list of these limitations, see the [Current Limitations](https://github.com/GeyserMC/Geyser/wiki/Current-Limitations) page. diff --git a/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java b/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java index 2053e0715..e14b0e95e 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/ChunkUtils.java @@ -74,12 +74,16 @@ public class ChunkUtils { * The minimum height Bedrock Edition will accept. */ private static final int MINIMUM_ACCEPTED_HEIGHT = 0; - private static final int MINIMUM_ACCEPTED_HEIGHT_OVERWORLD = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? -64 : MINIMUM_ACCEPTED_HEIGHT; + private static final int CAVES_AND_CLIFFS_MINIMUM_HEIGHT = -64; + private static final int MINIMUM_ACCEPTED_HEIGHT_OVERWORLD = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? + CAVES_AND_CLIFFS_MINIMUM_HEIGHT : MINIMUM_ACCEPTED_HEIGHT; /** * The maximum chunk height Bedrock Edition will accept, from the lowest point to the highest. */ private static final int MAXIMUM_ACCEPTED_HEIGHT = 256; - private static final int MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? 384 : MAXIMUM_ACCEPTED_HEIGHT; + private static final int CAVES_AND_CLIFFS_MAXIMUM_HEIGHT = 384; + private static final int MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? + CAVES_AND_CLIFFS_MAXIMUM_HEIGHT : MAXIMUM_ACCEPTED_HEIGHT; public static final byte[] EMPTY_CHUNK_DATA; public static final byte[] EMPTY_BIOME_DATA; @@ -454,11 +458,23 @@ public class ChunkUtils { throw new RuntimeException("Maximum Y must be a multiple of 16!"); } - session.getChunkCache().setExtendedHeight(DimensionUtils.javaToBedrock(session.getDimension()) == 0 && session.getConnector().getConfig().isExtendedWorldHeight()); + int dimension = DimensionUtils.javaToBedrock(session.getDimension()); + boolean extendedHeight = dimension == 0 && session.getConnector().getConfig().isExtendedWorldHeight(); + session.getChunkCache().setExtendedHeight(extendedHeight); - if (minY < (session.getChunkCache().isExtendedHeight() ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT) - || maxY > (session.getChunkCache().isExtendedHeight() ? MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD : MAXIMUM_ACCEPTED_HEIGHT)) { - session.getConnector().getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.network.translator.chunk.out_of_bounds")); + if (minY < (extendedHeight ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT) + || maxY > (extendedHeight ? MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD : MAXIMUM_ACCEPTED_HEIGHT)) { + if (minY >= CAVES_AND_CLIFFS_MINIMUM_HEIGHT && maxY <= CAVES_AND_CLIFFS_MAXIMUM_HEIGHT && dimension == 0 && !session.getConnector().getConfig().isExtendedWorldHeight()) { + // This dimension uses heights that would be fixed by enabling the experimental toggle + session.getConnector().getLogger().warning( + LanguageUtils.getLocaleStringLog("geyser.network.translator.chunk.out_of_bounds.caves_and_cliffs", + "extended-world-height")); + } else { + session.getConnector().getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.network.translator.chunk.out_of_bounds", + extendedHeight ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT, + extendedHeight ? MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD : MAXIMUM_ACCEPTED_HEIGHT, + session.getDimension())); + } } session.getChunkCache().setMinY(minY); diff --git a/connector/src/main/resources/config.yml b/connector/src/main/resources/config.yml index 334d86f95..3cbdb2e55 100644 --- a/connector/src/main/resources/config.yml +++ b/connector/src/main/resources/config.yml @@ -57,9 +57,9 @@ remote: # This is designed to be used for forced hosts on proxies forward-hostname: false -# Allows the overworld world height to be extended from 0 - 255 to -64 - 320. This option cannot be changed during a reload. +# Allows the overworld world height to be extended from 0 - 255 to -64 - 319. This option cannot be changed during a reload. # 1.17.0-1.17.2 Bedrock clients cannot connect with this option enabled. -# Performance issues may occur for Bedrock clients as this is an experimental toggle on their end. +# Performance issues and/or additional bugs may occur for Bedrock clients as this is an experimental toggle on their end. extended-world-height: false # Floodgate uses encryption to ensure use from authorised sources. diff --git a/connector/src/main/resources/languages b/connector/src/main/resources/languages index fcc8f01e2..c8923b1f7 160000 --- a/connector/src/main/resources/languages +++ b/connector/src/main/resources/languages @@ -1 +1 @@ -Subproject commit fcc8f01e25e481c9c82f2ee9bff23111ec781dd7 +Subproject commit c8923b1f71c7f66621729be47dec7f911606c6a1