mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Support 1.21.120 (#5936)
* Initial work on 1.21.120 support * Version item components, update creative items * Global api changes
This commit is contained in:
@@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
|
||||
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
|
||||
|
||||
## Supported Versions
|
||||
Geyser is currently supporting Minecraft Bedrock 1.21.90 - 1.21.114 and Minecraft Java 1.21.9 - 1.21.10. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
|
||||
Geyser is currently supporting Minecraft Bedrock 1.21.90 - 1.21.120 and Minecraft Java 1.21.9 - 1.21.10. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
|
||||
|
||||
## Setting Up
|
||||
Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser.
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v819.Bedrock_v819;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v827.Bedrock_v827;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v844.Bedrock_v844;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v859.Bedrock_v859;
|
||||
import org.cloudburstmc.protocol.bedrock.netty.codec.packet.BedrockPacketCodec;
|
||||
import org.geysermc.geyser.api.util.MinecraftVersion;
|
||||
import org.geysermc.geyser.impl.MinecraftVersionImpl;
|
||||
@@ -87,6 +88,7 @@ public final class GameProtocol {
|
||||
register(Bedrock_v819.CODEC, "1.21.93", "1.21.94");
|
||||
register(Bedrock_v827.CODEC, "1.21.100", "1.21.101");
|
||||
register(Bedrock_v844.CODEC, "1.21.111", "1.21.112", "1.21.113", "1.21.114");
|
||||
register(Bedrock_v859.CODEC, "1.21.120");
|
||||
|
||||
MinecraftVersion latestBedrock = SUPPORTED_BEDROCK_VERSIONS.get(SUPPORTED_BEDROCK_VERSIONS.size() - 1);
|
||||
DEFAULT_BEDROCK_VERSION = latestBedrock.versionString();
|
||||
|
||||
@@ -125,11 +125,6 @@ public class LoggingPacketHandler implements BedrockPacketHandler {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(CraftingEventPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(EntityEventPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
@@ -165,11 +160,6 @@ public class LoggingPacketHandler implements BedrockPacketHandler {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(ItemFrameDropItemPacket packet) {
|
||||
return defaultHandler(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketSignal handle(LabTablePacket packet) {
|
||||
return defaultHandler(packet);
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.google.common.collect.Interners;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectMaps;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||
@@ -47,6 +48,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v819.Bedrock_v819;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v827.Bedrock_v827;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v844.Bedrock_v844;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v859.Bedrock_v859;
|
||||
import org.cloudburstmc.protocol.bedrock.data.BlockPropertyData;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
@@ -124,6 +126,7 @@ public final class BlockRegistryPopulator {
|
||||
.put(ObjectIntPair.of("1_21_90", Bedrock_v819.CODEC.getProtocolVersion()), Conversion827_819::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_100", Bedrock_v827.CODEC.getProtocolVersion()), Conversion844_827::remapBlock)
|
||||
.put(ObjectIntPair.of("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()), tag -> tag)
|
||||
.put(ObjectIntPair.of("1_21_110", Bedrock_v859.CODEC.getProtocolVersion()), tag -> tag)
|
||||
.build();
|
||||
|
||||
// We can keep this strong as nothing should be garbage collected
|
||||
|
||||
@@ -49,6 +49,7 @@ import org.cloudburstmc.protocol.bedrock.codec.v818.Bedrock_v818;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v819.Bedrock_v819;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v827.Bedrock_v827;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v844.Bedrock_v844;
|
||||
import org.cloudburstmc.protocol.bedrock.codec.v859.Bedrock_v859;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.ItemDefinition;
|
||||
import org.cloudburstmc.protocol.bedrock.data.definitions.SimpleItemDefinition;
|
||||
@@ -196,6 +197,7 @@ public class ItemRegistryPopulator {
|
||||
paletteVersions.add(new PaletteVersion("1_21_93", Bedrock_v819.CODEC.getProtocolVersion(), eightOneNineFallbacks, Conversion844_827::remapItem));
|
||||
paletteVersions.add(new PaletteVersion("1_21_100", Bedrock_v827.CODEC.getProtocolVersion(), eightTwoSevenFallbacks, Conversion844_827::remapItem));
|
||||
paletteVersions.add(new PaletteVersion("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()));
|
||||
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v859.CODEC.getProtocolVersion()));
|
||||
|
||||
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
|
||||
|
||||
@@ -209,13 +211,6 @@ public class ItemRegistryPopulator {
|
||||
throw new AssertionError("Unable to load Java runtime item IDs", e);
|
||||
}
|
||||
|
||||
NbtMap vanillaComponents;
|
||||
try (InputStream stream = bootstrap.getResourceOrThrow("bedrock/item_components.nbt")) {
|
||||
vanillaComponents = (NbtMap) NbtUtils.createGZIPReader(stream, true, true).readTag();
|
||||
} catch (Exception e) {
|
||||
throw new AssertionError("Unable to load Bedrock item components", e);
|
||||
}
|
||||
|
||||
boolean customItemsAllowed = GeyserImpl.getInstance().getConfig().isAddNonBedrockItems();
|
||||
|
||||
// List values here is important compared to HashSet - we need to preserve the order of what's given to us
|
||||
@@ -242,6 +237,13 @@ public class ItemRegistryPopulator {
|
||||
throw new AssertionError("Unable to load Bedrock runtime item IDs", e);
|
||||
}
|
||||
|
||||
NbtMap vanillaComponents;
|
||||
try (InputStream stream = bootstrap.getResourceOrThrow("bedrock/item_components.%s.nbt".formatted(palette.version()))) {
|
||||
vanillaComponents = (NbtMap) NbtUtils.createGZIPReader(stream, true, true).readTag();
|
||||
} catch (Exception e) {
|
||||
throw new AssertionError("Unable to load Bedrock item components", e);
|
||||
}
|
||||
|
||||
// Used for custom items
|
||||
int nextFreeBedrockId = 0;
|
||||
Int2ObjectMap<ItemDefinition> registry = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -274,6 +274,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||
*/
|
||||
@Setter
|
||||
private List<String> certChainData;
|
||||
@Setter
|
||||
private String token;
|
||||
|
||||
@NonNull
|
||||
@Setter
|
||||
|
||||
@@ -190,15 +190,22 @@ public final class FloodgateSkinUploader {
|
||||
};
|
||||
}
|
||||
|
||||
public void uploadSkin(List<String> chainData, String clientData) {
|
||||
if (chainData == null || clientData == null) {
|
||||
public void uploadSkin(GeyserSession session) {
|
||||
List<String> chainData = session.getCertChainData();
|
||||
String token = session.getToken();
|
||||
String clientData = session.getClientData().getOriginalString();
|
||||
if ((chainData == null && token == null) || clientData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectNode node = JACKSON.createObjectNode();
|
||||
if (chainData != null) {
|
||||
ArrayNode chainDataNode = JACKSON.createArrayNode();
|
||||
chainData.forEach(chainDataNode::add);
|
||||
node.set("chain_data", chainDataNode);
|
||||
} else {
|
||||
node.put("token", token);
|
||||
}
|
||||
node.put("client_data", clientData);
|
||||
|
||||
// The reason why I don't like Jackson
|
||||
@@ -218,7 +225,7 @@ public final class FloodgateSkinUploader {
|
||||
}
|
||||
|
||||
private void reconnectLater(GeyserImpl geyser) {
|
||||
// we ca only reconnect when the thread pool is open
|
||||
// we can only reconnect when the thread pool is open
|
||||
if (geyser.getScheduledThread().isShutdown() || closed) {
|
||||
logger.info("The skin uploader has been closed");
|
||||
return;
|
||||
|
||||
@@ -66,11 +66,12 @@ public class JavaLoginFinishedTranslator extends PacketTranslator<ClientboundLog
|
||||
// because otherwise the global server returns the data too fast.
|
||||
// We upload it after we know for sure that the target server
|
||||
// is ready to handle the result of the global server.
|
||||
session.getGeyser().getSkinUploader().uploadSkin(session.getCertChainData(), session.getClientData().getOriginalString());
|
||||
session.getGeyser().getSkinUploader().uploadSkin(session);
|
||||
}
|
||||
|
||||
// We no longer need these variables; they're just taking up space in memory now
|
||||
session.setCertChainData(null);
|
||||
session.setToken(null);
|
||||
session.getClientData().setOriginalString(null);
|
||||
|
||||
// configuration phase stuff that the vanilla client replies with after receiving the GameProfilePacket
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import net.raphimc.minecraftauth.step.msa.StepMsaDeviceCode;
|
||||
import org.cloudburstmc.protocol.bedrock.data.auth.AuthPayload;
|
||||
import org.cloudburstmc.protocol.bedrock.data.auth.CertificateChainPayload;
|
||||
import org.cloudburstmc.protocol.bedrock.data.auth.TokenPayload;
|
||||
import org.cloudburstmc.protocol.bedrock.packet.LoginPacket;
|
||||
import org.cloudburstmc.protocol.bedrock.packet.ServerToClientHandshakePacket;
|
||||
import org.cloudburstmc.protocol.bedrock.util.ChainValidationResult;
|
||||
@@ -51,7 +52,6 @@ import org.geysermc.geyser.text.GeyserLocale;
|
||||
import javax.crypto.SecretKey;
|
||||
import java.security.KeyPair;
|
||||
import java.security.PublicKey;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public class LoginEncryptionUtils {
|
||||
@@ -81,13 +81,13 @@ public class LoginEncryptionUtils {
|
||||
long issuedAt = rawIssuedAt != null ? rawIssuedAt : -1;
|
||||
|
||||
IdentityData extraData = result.identityClaims().extraData;
|
||||
// TODO!!! identity won't persist
|
||||
session.setAuthData(new AuthData(extraData.displayName, extraData.identity, extraData.xuid, issuedAt));
|
||||
if (authPayload instanceof CertificateChainPayload certificateChainPayload) {
|
||||
if (authPayload instanceof TokenPayload tokenPayload) {
|
||||
session.setToken(tokenPayload.getToken());
|
||||
} else if (authPayload instanceof CertificateChainPayload certificateChainPayload) {
|
||||
session.setCertChainData(certificateChainPayload.getChain());
|
||||
} else {
|
||||
GeyserImpl.getInstance().getLogger().warning("Received new auth payload!");
|
||||
session.setCertChainData(List.of());
|
||||
GeyserImpl.getInstance().getLogger().warning("Unknown auth payload! Skin uploading will not work");
|
||||
}
|
||||
|
||||
PublicKey identityPublicKey = result.identityClaims().parsedIdentityPublicKey();
|
||||
|
||||
9516
core/src/main/resources/bedrock/creative_items.1_21_120.json
Normal file
9516
core/src/main/resources/bedrock/creative_items.1_21_120.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
core/src/main/resources/bedrock/item_components.1_21_110.nbt
Normal file
BIN
core/src/main/resources/bedrock/item_components.1_21_110.nbt
Normal file
Binary file not shown.
BIN
core/src/main/resources/bedrock/item_components.1_21_120.nbt
Normal file
BIN
core/src/main/resources/bedrock/item_components.1_21_120.nbt
Normal file
Binary file not shown.
BIN
core/src/main/resources/bedrock/item_components.1_21_90.nbt
Normal file
BIN
core/src/main/resources/bedrock/item_components.1_21_90.nbt
Normal file
Binary file not shown.
BIN
core/src/main/resources/bedrock/item_components.1_21_93.nbt
Normal file
BIN
core/src/main/resources/bedrock/item_components.1_21_93.nbt
Normal file
Binary file not shown.
11330
core/src/main/resources/bedrock/runtime_item_states.1_21_120.json
Normal file
11330
core/src/main/resources/bedrock/runtime_item_states.1_21_120.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,9 +9,9 @@ netty = "4.2.7.Final"
|
||||
guava = "29.0-jre"
|
||||
gson = "2.3.1" # Provided by Spigot 1.8.8
|
||||
websocket = "1.5.1"
|
||||
protocol-connection = "3.0.0.Beta8-20250929.213851-8"
|
||||
protocol-common = "3.0.0.Beta8-20250929.213851-8"
|
||||
protocol-codec = "3.0.0.Beta8-20250929.213851-8"
|
||||
protocol-connection = "3.0.0.Beta10-20251014.180344-2"
|
||||
protocol-common = "3.0.0.Beta10-20251014.180344-2"
|
||||
protocol-codec = "3.0.0.Beta10-20251014.180344-2"
|
||||
raknet = "1.0.0.CR3-20250811.214335-20"
|
||||
minecraftauth = "4.1.1"
|
||||
mcprotocollib = "1.21.9-20251026.124736-17"
|
||||
|
||||
Reference in New Issue
Block a user