3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-03 08:21:06 +02:00

Remove 1.17.10 support; extended world height is always enabled

Dieser Commit ist enthalten in:
Camotoy 2021-11-12 09:42:35 -05:00
Ursprung 09e3793fb2
Commit dc5edc0a2c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
16 geänderte Dateien mit 57 neuen und 19103 gelöschten Zeilen

Datei anzeigen

@ -46,8 +46,6 @@ public interface GeyserConfiguration {
Map<String, ? extends IUserAuthenticationInfo> getUserAuths(); Map<String, ? extends IUserAuthenticationInfo> getUserAuths();
boolean isExtendedWorldHeight();
boolean isCommandSuggestions(); boolean isCommandSuggestions();
@JsonIgnore @JsonIgnore

Datei anzeigen

@ -62,9 +62,6 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
private BedrockConfiguration bedrock = new BedrockConfiguration(); private BedrockConfiguration bedrock = new BedrockConfiguration();
private RemoteConfiguration remote = new RemoteConfiguration(); private RemoteConfiguration remote = new RemoteConfiguration();
@JsonProperty("extended-world-height")
private boolean extendedWorldHeight = false;
@JsonProperty("floodgate-key-file") @JsonProperty("floodgate-key-file")
private String floodgateKeyFile = "key.pem"; private String floodgateKeyFile = "key.pem";

Datei anzeigen

@ -26,7 +26,6 @@
package org.geysermc.connector.network; package org.geysermc.connector.network;
import com.nukkitx.protocol.bedrock.BedrockPacketCodec; import com.nukkitx.protocol.bedrock.BedrockPacketCodec;
import com.nukkitx.protocol.bedrock.v448.Bedrock_v448;
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465; import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
import com.nukkitx.protocol.bedrock.v471.Bedrock_v471; import com.nukkitx.protocol.bedrock.v471.Bedrock_v471;
@ -42,18 +41,15 @@ public class BedrockProtocol {
* Default Bedrock codec that should act as a fallback. Should represent the latest available * Default Bedrock codec that should act as a fallback. Should represent the latest available
* release of the game that Geyser supports. * release of the game that Geyser supports.
*/ */
public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v448.V448_CODEC; public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v471.V471_CODEC;
/** /**
* A list of all supported Bedrock versions that can join Geyser * A list of all supported Bedrock versions that can join Geyser
*/ */
public static final List<BedrockPacketCodec> SUPPORTED_BEDROCK_CODECS = new ArrayList<>(); public static final List<BedrockPacketCodec> SUPPORTED_BEDROCK_CODECS = new ArrayList<>();
static { static {
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder()
.minecraftVersion("1.17.10/1.17.11")
.build());
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v465.V465_CODEC); SUPPORTED_BEDROCK_CODECS.add(Bedrock_v465.V465_CODEC);
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v471.V471_CODEC); SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
} }
/** /**

Datei anzeigen

@ -30,6 +30,7 @@ import com.nukkitx.protocol.bedrock.BedrockPacketCodec;
import com.nukkitx.protocol.bedrock.data.ExperimentData; import com.nukkitx.protocol.bedrock.data.ExperimentData;
import com.nukkitx.protocol.bedrock.data.ResourcePackType; import com.nukkitx.protocol.bedrock.data.ResourcePackType;
import com.nukkitx.protocol.bedrock.packet.*; import com.nukkitx.protocol.bedrock.packet.*;
import com.nukkitx.protocol.bedrock.v471.Bedrock_v471;
import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.common.AuthType; import org.geysermc.connector.common.AuthType;
import org.geysermc.connector.configuration.GeyserConfiguration; import org.geysermc.connector.configuration.GeyserConfiguration;
@ -151,8 +152,8 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
stackPacket.getExperiments().add(new ExperimentData("data_driven_items", true)); stackPacket.getExperiments().add(new ExperimentData("data_driven_items", true));
} }
if (session.getConnector().getConfig().isExtendedWorldHeight()) { if (session.getUpstream().getProtocolVersion() <= Bedrock_v471.V471_CODEC.getProtocolVersion()) {
// Allow extended world height in the overworld to work // Allow extended world height in the overworld to work for pre-1.18 clients
stackPacket.getExperiments().add(new ExperimentData("caves_and_cliffs", true)); stackPacket.getExperiments().add(new ExperimentData("caves_and_cliffs", true));
} }

Datei anzeigen

@ -59,6 +59,7 @@ import com.nukkitx.protocol.bedrock.data.command.CommandPermission;
import com.nukkitx.protocol.bedrock.data.entity.EntityData; import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import com.nukkitx.protocol.bedrock.packet.*; import com.nukkitx.protocol.bedrock.packet.*;
import com.nukkitx.protocol.bedrock.v471.Bedrock_v471;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.EventLoop; import io.netty.channel.EventLoop;
import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.ints.*;
@ -1200,7 +1201,7 @@ public class GeyserSession implements CommandSender {
settings.setServerAuthoritativeBlockBreaking(false); settings.setServerAuthoritativeBlockBreaking(false);
startGamePacket.setPlayerMovementSettings(settings); startGamePacket.setPlayerMovementSettings(settings);
if (connector.getConfig().isExtendedWorldHeight()) { if (upstream.getProtocolVersion() <= Bedrock_v471.V471_CODEC.getProtocolVersion()) {
startGamePacket.getExperiments().add(new ExperimentData("caves_and_cliffs", true)); startGamePacket.getExperiments().add(new ExperimentData("caves_and_cliffs", true));
} }

Datei anzeigen

@ -33,7 +33,6 @@ import com.nukkitx.math.vector.Vector3d;
import com.nukkitx.math.vector.Vector3f; import com.nukkitx.math.vector.Vector3f;
import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket; import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket;
import com.nukkitx.protocol.bedrock.packet.MovePlayerPacket; import com.nukkitx.protocol.bedrock.packet.MovePlayerPacket;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.common.ChatColor; import org.geysermc.connector.common.ChatColor;
import org.geysermc.connector.entity.player.SessionPlayerEntity; import org.geysermc.connector.entity.player.SessionPlayerEntity;
import org.geysermc.connector.entity.type.EntityType; import org.geysermc.connector.entity.type.EntityType;
@ -43,14 +42,9 @@ import org.geysermc.connector.network.translators.Translator;
@Translator(packet = MovePlayerPacket.class) @Translator(packet = MovePlayerPacket.class)
public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPacket> { public class BedrockMovePlayerTranslator extends PacketTranslator<MovePlayerPacket> {
/* The upper and lower bounds to check for the void floor that only exists in Bedrock */ /* The upper and lower bounds to check for the void floor that only exists in Bedrock. These are the constants for the overworld. */
private static final int BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y; private static final int BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y = -104;
private static final int BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y; private static final int BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y = BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y + 2;
static {
BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight() ? -104 : -40;
BEDROCK_OVERWORLD_VOID_FLOOR_LOWER_Y = BEDROCK_OVERWORLD_VOID_FLOOR_UPPER_Y + 2;
}
@Override @Override
public void translate(GeyserSession session, MovePlayerPacket packet) { public void translate(GeyserSession session, MovePlayerPacket packet) {

Datei anzeigen

@ -39,8 +39,8 @@ import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.PacketTranslator; import org.geysermc.connector.network.translators.PacketTranslator;
import org.geysermc.connector.network.translators.Translator; import org.geysermc.connector.network.translators.Translator;
import org.geysermc.connector.network.translators.world.chunk.ChunkSection;
import org.geysermc.connector.network.translators.world.BiomeTranslator; import org.geysermc.connector.network.translators.world.BiomeTranslator;
import org.geysermc.connector.network.translators.world.chunk.ChunkSection;
import org.geysermc.connector.utils.ChunkUtils; import org.geysermc.connector.utils.ChunkUtils;
import static org.geysermc.connector.utils.ChunkUtils.MINIMUM_ACCEPTED_HEIGHT; import static org.geysermc.connector.utils.ChunkUtils.MINIMUM_ACCEPTED_HEIGHT;
@ -48,8 +48,6 @@ import static org.geysermc.connector.utils.ChunkUtils.MINIMUM_ACCEPTED_HEIGHT_OV
@Translator(packet = ServerChunkDataPacket.class) @Translator(packet = ServerChunkDataPacket.class)
public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPacket> { public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPacket> {
// Caves and cliffs supports 3D biomes by implementing a very similar palette system to blocks
private static final boolean NEW_BIOME_WRITE = GeyserConnector.getInstance().getConfig().isExtendedWorldHeight();
@Override @Override
public void translate(GeyserSession session, ServerChunkDataPacket packet) { public void translate(GeyserSession session, ServerChunkDataPacket packet) {
@ -84,11 +82,7 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
ChunkSection section = sections[i]; ChunkSection section = sections[i];
size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize(); size += (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).estimateNetworkSize();
} }
if (NEW_BIOME_WRITE) { size += ChunkUtils.EMPTY_CHUNK_DATA.length; // Consists only of biome data
size += ChunkUtils.EMPTY_CHUNK_DATA.length; // Consists only of biome data
} else {
size += 256; // Biomes pre-1.18
}
size += 1; // Border blocks size += 1; // Border blocks
size += 1; // Extra data length (always 0) size += 1; // Extra data length (always 0)
size += chunkData.blockEntities().length * 64; // Conservative estimate of 64 bytes per tile entity size += chunkData.blockEntities().length * 64; // Conservative estimate of 64 bytes per tile entity
@ -102,28 +96,25 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
(section != null ? section : session.getBlockMappings().getEmptyChunkSection()).writeToNetwork(byteBuf); (section != null ? section : session.getBlockMappings().getEmptyChunkSection()).writeToNetwork(byteBuf);
} }
if (NEW_BIOME_WRITE) { // At this point we're dealing with Bedrock chunk sections
// At this point we're dealing with Bedrock chunk sections boolean overworld = session.getChunkCache().isExtendedHeight();
boolean overworld = session.getChunkCache().isExtendedHeight(); int dimensionOffset = (overworld ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT) >> 4;
int dimensionOffset = (overworld ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT) >> 4; for (int i = 0; i < sectionCount; i++) {
for (int i = 0; i < sectionCount; i++) { int biomeYOffset = dimensionOffset + i;
int biomeYOffset = dimensionOffset + i; if (biomeYOffset < yOffset) {
if (biomeYOffset < yOffset) { // Ignore this biome section since it goes below the height of the Java world
// Ignore this biome section since it goes below the height of the Java world
byteBuf.writeBytes(ChunkUtils.EMPTY_BIOME_DATA);
continue;
}
BiomeTranslator.toNewBedrockBiome(session, column.getBiomeData(), i + (dimensionOffset - yOffset)).writeToNetwork(byteBuf);
}
// As of 1.17.10, Bedrock hardcodes to always read 32 biome sections
int remainingEmptyBiomes = 32 - sectionCount;
for (int i = 0; i < remainingEmptyBiomes; i++) {
byteBuf.writeBytes(ChunkUtils.EMPTY_BIOME_DATA); byteBuf.writeBytes(ChunkUtils.EMPTY_BIOME_DATA);
continue;
} }
} else { BiomeTranslator.toNewBedrockBiome(session, column.getBiomeData(), i + (dimensionOffset - yOffset)).writeToNetwork(byteBuf);
byteBuf.writeBytes(BiomeTranslator.toBedrockBiome(session, column.getBiomeData())); // Biomes - 256 bytes
} }
// As of 1.17.10, Bedrock hardcodes to always read 32 biome sections
int remainingEmptyBiomes = 32 - sectionCount;
for (int i = 0; i < remainingEmptyBiomes; i++) {
byteBuf.writeBytes(ChunkUtils.EMPTY_BIOME_DATA);
}
byteBuf.writeByte(0); // Border blocks - Edu edition only byteBuf.writeByte(0); // Border blocks - Edu edition only
VarInts.writeUnsignedInt(byteBuf, 0); // extra data length, 0 for now VarInts.writeUnsignedInt(byteBuf, 0); // extra data length, 0 for now

Datei anzeigen

@ -28,7 +28,6 @@ package org.geysermc.connector.registry.populator;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.nukkitx.nbt.*; import com.nukkitx.nbt.*;
import com.nukkitx.protocol.bedrock.v448.Bedrock_v448;
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465; import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
import com.nukkitx.protocol.bedrock.v471.Bedrock_v471; import com.nukkitx.protocol.bedrock.v471.Bedrock_v471;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
@ -66,7 +65,6 @@ public class BlockRegistryPopulator {
static { static {
ImmutableMap.Builder<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> stateMapperBuilder = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder() ImmutableMap.Builder<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>> stateMapperBuilder = ImmutableMap.<ObjectIntPair<String>, BiFunction<String, NbtMapBuilder, String>>builder()
.put(ObjectIntPair.of("1_17_10", Bedrock_v448.V448_CODEC.getProtocolVersion()), EMPTY_MAPPER)
.put(ObjectIntPair.of("1_17_30", Bedrock_v465.V465_CODEC.getProtocolVersion()), EMPTY_MAPPER) .put(ObjectIntPair.of("1_17_30", Bedrock_v465.V465_CODEC.getProtocolVersion()), EMPTY_MAPPER)
.put(ObjectIntPair.of("1_17_40", Bedrock_v471.V471_CODEC.getProtocolVersion()), EMPTY_MAPPER); .put(ObjectIntPair.of("1_17_40", Bedrock_v471.V471_CODEC.getProtocolVersion()), EMPTY_MAPPER);

Datei anzeigen

@ -35,7 +35,6 @@ import com.nukkitx.protocol.bedrock.data.SoundEvent;
import com.nukkitx.protocol.bedrock.data.inventory.ComponentItemData; import com.nukkitx.protocol.bedrock.data.inventory.ComponentItemData;
import com.nukkitx.protocol.bedrock.data.inventory.ItemData; import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
import com.nukkitx.protocol.bedrock.packet.StartGamePacket; import com.nukkitx.protocol.bedrock.packet.StartGamePacket;
import com.nukkitx.protocol.bedrock.v448.Bedrock_v448;
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465; import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
import com.nukkitx.protocol.bedrock.v471.Bedrock_v471; import com.nukkitx.protocol.bedrock.v471.Bedrock_v471;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@ -63,12 +62,6 @@ public class ItemRegistryPopulator {
static { static {
PALETTE_VERSIONS = new Object2ObjectOpenHashMap<>(); PALETTE_VERSIONS = new Object2ObjectOpenHashMap<>();
if (GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) {
PALETTE_VERSIONS.put("1_17_10.caves_and_cliffs", new PaletteVersion(Bedrock_v448.V448_CODEC.getProtocolVersion(), Collections.emptyMap()));
} else {
PALETTE_VERSIONS.put("1_17_10", new PaletteVersion(Bedrock_v448.V448_CODEC.getProtocolVersion(), Collections.emptyMap()));
}
PALETTE_VERSIONS.put("1_17_30", new PaletteVersion(Bedrock_v465.V465_CODEC.getProtocolVersion(), Collections.emptyMap())); PALETTE_VERSIONS.put("1_17_30", new PaletteVersion(Bedrock_v465.V465_CODEC.getProtocolVersion(), Collections.emptyMap()));
PALETTE_VERSIONS.put("1_17_40", new PaletteVersion(Bedrock_v471.V471_CODEC.getProtocolVersion(), Collections.emptyMap())); PALETTE_VERSIONS.put("1_17_40", new PaletteVersion(Bedrock_v471.V471_CODEC.getProtocolVersion(), Collections.emptyMap()));
} }
@ -169,10 +162,7 @@ public class ItemRegistryPopulator {
} }
String identifier = itemNode.get("id").textValue(); String identifier = itemNode.get("id").textValue();
if (identifier.equals("minecraft:sculk_sensor") && !GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) { if (identifier.equals("minecraft:debug_stick")) {
// https://github.com/GeyserMC/Geyser/issues/2564
continue;
} else if (identifier.equals("minecraft:debug_stick")) {
// Just shows an empty texture; either way it doesn't exist in the creative menu on Java // Just shows an empty texture; either way it doesn't exist in the creative menu on Java
continue; continue;
} }
@ -223,9 +213,6 @@ public class ItemRegistryPopulator {
if (!usingFurnaceMinecart) { if (!usingFurnaceMinecart) {
javaOnlyItems.add("minecraft:furnace_minecart"); javaOnlyItems.add("minecraft:furnace_minecart");
} }
if (!GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) {
javaOnlyItems.add("minecraft:sculk_sensor");
}
// Java-only items for this version // Java-only items for this version
javaOnlyItems.addAll(palette.getValue().additionalTranslatedItems().keySet()); javaOnlyItems.addAll(palette.getValue().additionalTranslatedItems().keySet());
@ -239,7 +226,8 @@ public class ItemRegistryPopulator {
// This items has a mapping specifically for this version of the game // This items has a mapping specifically for this version of the game
mappingItem = entry.getValue(); mappingItem = entry.getValue();
} }
if (javaIdentifier.equals("minecraft:sculk_sensor") && GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) { if (javaIdentifier.equals("minecraft:sculk_sensor")) {
// TODO fix in mappings
mappingItem.setBedrockIdentifier("minecraft:sculk_sensor"); mappingItem.setBedrockIdentifier("minecraft:sculk_sensor");
} }

Datei anzeigen

@ -69,49 +69,40 @@ public class ChunkUtils {
* The minimum height Bedrock Edition will accept. * The minimum height Bedrock Edition will accept.
*/ */
public static final int MINIMUM_ACCEPTED_HEIGHT = 0; public static final int MINIMUM_ACCEPTED_HEIGHT = 0;
private static final int CAVES_AND_CLIFFS_MINIMUM_HEIGHT = -64; public static final int MINIMUM_ACCEPTED_HEIGHT_OVERWORLD = -64;
public 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. * 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 = 256;
private static final int CAVES_AND_CLIFFS_MAXIMUM_HEIGHT = 384; private static final int MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD = 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_CHUNK_DATA;
public static final byte[] EMPTY_BIOME_DATA; public static final byte[] EMPTY_BIOME_DATA;
static { static {
if (GeyserConnector.getInstance().getConfig().isExtendedWorldHeight()) { ByteBuf byteBuf = Unpooled.buffer();
ByteBuf byteBuf = Unpooled.buffer(); try {
try { BlockStorage blockStorage = new BlockStorage(0);
BlockStorage blockStorage = new BlockStorage(0); blockStorage.writeToNetwork(byteBuf);
blockStorage.writeToNetwork(byteBuf);
EMPTY_BIOME_DATA = new byte[byteBuf.readableBytes()]; EMPTY_BIOME_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_BIOME_DATA); byteBuf.readBytes(EMPTY_BIOME_DATA);
} finally { } finally {
byteBuf.release(); byteBuf.release();
}
byteBuf = Unpooled.buffer();
try {
for (int i = 0; i < 32; i++) {
byteBuf.writeBytes(EMPTY_BIOME_DATA);
} }
byteBuf = Unpooled.buffer(); byteBuf.writeByte(0); // Border
try {
for (int i = 0; i < 32; i++) {
byteBuf.writeBytes(EMPTY_BIOME_DATA);
}
byteBuf.writeByte(0); // Border EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(EMPTY_CHUNK_DATA);
EMPTY_CHUNK_DATA = new byte[byteBuf.readableBytes()]; } finally {
byteBuf.readBytes(EMPTY_CHUNK_DATA); byteBuf.release();
} finally {
byteBuf.release();
}
} else {
EMPTY_BIOME_DATA = null; // Unused
EMPTY_CHUNK_DATA = new byte[257]; // 256 bytes for biomes, one for borders
} }
} }
@ -441,24 +432,17 @@ public class ChunkUtils {
} }
int dimension = DimensionUtils.javaToBedrock(session.getDimension()); int dimension = DimensionUtils.javaToBedrock(session.getDimension());
boolean extendedHeight = dimension == 0 && session.getConnector().getConfig().isExtendedWorldHeight(); boolean extendedHeight = dimension == 0;
session.getChunkCache().setExtendedHeight(extendedHeight); session.getChunkCache().setExtendedHeight(extendedHeight);
// Yell in the console if the world height is too height in the current scenario // Yell in the console if the world height is too height in the current scenario
// The constraints change depending on if the player is in the overworld or not, and if experimental height is enabled // The constraints change depending on if the player is in the overworld or not, and if experimental height is enabled
if (minY < (extendedHeight ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT) if (minY < (extendedHeight ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT)
|| maxY > (extendedHeight ? MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD : MAXIMUM_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()) { session.getConnector().getLogger().warning(LanguageUtils.getLocaleStringLog("geyser.network.translator.chunk.out_of_bounds",
// This dimension uses heights that would be fixed by enabling the experimental toggle extendedHeight ? MINIMUM_ACCEPTED_HEIGHT_OVERWORLD : MINIMUM_ACCEPTED_HEIGHT,
session.getConnector().getLogger().warning( extendedHeight ? MAXIMUM_ACCEPTED_HEIGHT_OVERWORLD : MAXIMUM_ACCEPTED_HEIGHT,
LanguageUtils.getLocaleStringLog("geyser.network.translator.chunk.out_of_bounds.caves_and_cliffs", session.getDimension()));
"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); session.getChunkCache().setMinY(minY);

Datei anzeigen

@ -60,10 +60,6 @@ remote:
# This is designed to be used for forced hosts on proxies # This is designed to be used for forced hosts on proxies
forward-hostname: false forward-hostname: false
# Allows the overworld world height to be extended from 0 - 255 to -64 - 319. This option cannot be changed during a reload.
# 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. # Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity) # This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate. # You can ignore this when not using Floodgate.