Skip to content

Commit 069264b

Browse files
committed
Drop 1.21.130, rename internal files to conform with 26.- prefixes, add 26.30 data
1 parent 53b5842 commit 069264b

34 files changed

Lines changed: 2207 additions & 208 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Special thanks to the DragonProxy project for being a trailblazer in protocol tr
1616

1717
## Supported Versions
1818

19-
| Edition | Supported Versions |
20-
|---------|------------------------------------------------------------------------------------------------------|
21-
| Bedrock | 1.21.130 - 1.21.132, 26.0, 26.1, 26.2, 26.3, 26.10, 26.20, 26.21, 26.22, 26.23 |
19+
| Edition | Supported Versions |
20+
|---------|------------------------------------------------------------------------------------------------------------|
21+
| Bedrock | 26.0, 26.1, 26.2, 26.3, 26.10, 26.20, 26.21, 26.22, 26.23, 26.30 |
2222
| Java | 26.1 - 26.1.2 (For older versions, [see this guide](https://geysermc.org/wiki/geyser/supported-versions/)) |
2323

2424
## Setting Up

core/src/main/java/org/geysermc/geyser/network/GameProtocol.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import it.unimi.dsi.fastutil.ints.IntList;
3030
import org.checkerframework.checker.nullness.qual.Nullable;
3131
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
32-
import org.cloudburstmc.protocol.bedrock.codec.v898.Bedrock_v898;
32+
import org.cloudburstmc.protocol.bedrock.codec.v1001.Bedrock_v1001;
3333
import org.cloudburstmc.protocol.bedrock.codec.v924.Bedrock_v924;
3434
import org.cloudburstmc.protocol.bedrock.codec.v944.Bedrock_v944;
3535
import org.cloudburstmc.protocol.bedrock.codec.v975.Bedrock_v975;
@@ -82,10 +82,10 @@ public final class GameProtocol {
8282

8383
static {
8484
// Strict ordering
85-
register(Bedrock_v898.CODEC, "1.21.130", "1.21.131", "1.21.132");
8685
register(Bedrock_v924.CODEC, "26.0", "26.1", "26.2", "26.3");
8786
register(Bedrock_v944.CODEC, "26.10");
8887
register(Bedrock_v975.CODEC, "26.20", "26.21", "26.22", "26.23");
88+
register(Bedrock_v1001.CODEC, "26.30");
8989

9090
MinecraftVersion latestBedrock = SUPPORTED_BEDROCK_VERSIONS.getLast();
9191
DEFAULT_BEDROCK_VERSION = latestBedrock.versionString();
@@ -137,11 +137,11 @@ private static void register(BedrockCodec codec) {
137137

138138
/* Bedrock convenience methods to gatekeep features and easily remove the check on version removal */
139139

140-
public static boolean is1_26_10orHigher(int protocolVersion) {
140+
public static boolean is26_10orHigher(int protocolVersion) {
141141
return protocolVersion >= Bedrock_v944.CODEC.getProtocolVersion();
142142
}
143143

144-
public static boolean is1_26_20orHigher(int protocolVersion) {
144+
public static boolean is26_20orHigher(int protocolVersion) {
145145
return protocolVersion >= Bedrock_v975.CODEC.getProtocolVersion();
146146
}
147147

core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.cloudburstmc.nbt.NbtMapBuilder;
4444
import org.cloudburstmc.nbt.NbtType;
4545
import org.cloudburstmc.nbt.NbtUtils;
46-
import org.cloudburstmc.protocol.bedrock.codec.v898.Bedrock_v898;
4746
import org.cloudburstmc.protocol.bedrock.codec.v924.Bedrock_v924;
4847
import org.cloudburstmc.protocol.bedrock.codec.v944.Bedrock_v944;
4948
import org.cloudburstmc.protocol.bedrock.codec.v975.Bedrock_v975;
@@ -120,12 +119,10 @@ private static void nullifyBlocksNbt() {
120119

121120
private static void registerBedrockBlocks() {
122121
var blockMappers = ImmutableMap.<ObjectIntPair<String>, Remapper>builder()
123-
// This is technically the same 1.21.111 palette; there have been no changes
124-
.put(ObjectIntPair.of("1_21_130", Bedrock_v898.CODEC.getProtocolVersion()), GoldenDandelionConverter::convert)
125-
// 26.0 also doesn't have any changes, so we re-use the same file
126-
.put(ObjectIntPair.of("1_21_130", Bedrock_v924.CODEC.getProtocolVersion()), GoldenDandelionConverter::convert)
127-
.put(ObjectIntPair.of("1_26_10", Bedrock_v944.CODEC.getProtocolVersion()), tag -> tag)
128-
.put(ObjectIntPair.of("1_26_20", Bedrock_v975.CODEC.getProtocolVersion()), tag -> tag)
122+
.put(ObjectIntPair.of("26_10", Bedrock_v924.CODEC.getProtocolVersion()), GoldenDandelionConverter::convert)
123+
.put(ObjectIntPair.of("26_10", Bedrock_v944.CODEC.getProtocolVersion()), tag -> tag)
124+
.put(ObjectIntPair.of("26_20", Bedrock_v975.CODEC.getProtocolVersion()), tag -> tag)
125+
.put(ObjectIntPair.of("26_30", Bedrock_v975.CODEC.getProtocolVersion()), tag -> tag)
129126
.build();
130127

131128
// We can keep this strong as nothing should be garbage collected

core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import org.cloudburstmc.nbt.NbtMapBuilder;
4747
import org.cloudburstmc.nbt.NbtType;
4848
import org.cloudburstmc.nbt.NbtUtils;
49-
import org.cloudburstmc.protocol.bedrock.codec.v898.Bedrock_v898;
49+
import org.cloudburstmc.protocol.bedrock.codec.v1001.Bedrock_v1001;
5050
import org.cloudburstmc.protocol.bedrock.codec.v924.Bedrock_v924;
5151
import org.cloudburstmc.protocol.bedrock.codec.v944.Bedrock_v944;
5252
import org.cloudburstmc.protocol.bedrock.codec.v975.Bedrock_v975;
@@ -145,11 +145,11 @@ interface Remapper {
145145
public static void populate() {
146146
Map<Item, Item> dandelion = Map.of(Items.GOLDEN_DANDELION, Items.DANDELION);
147147

148-
List<PaletteVersion> paletteVersions = new ArrayList<>(3);
149-
paletteVersions.add(new PaletteVersion("1_21_130", Bedrock_v898.CODEC.getProtocolVersion(), dandelion));
150-
paletteVersions.add(new PaletteVersion("1_26_0", Bedrock_v924.CODEC.getProtocolVersion(), dandelion));
151-
paletteVersions.add(new PaletteVersion("1_26_10", Bedrock_v944.CODEC.getProtocolVersion()));
152-
paletteVersions.add(new PaletteVersion("1_26_20", Bedrock_v975.CODEC.getProtocolVersion(), "1_26_10"));
148+
List<PaletteVersion> paletteVersions = new ArrayList<>(4);
149+
paletteVersions.add(new PaletteVersion("26_0", Bedrock_v924.CODEC.getProtocolVersion(), dandelion));
150+
paletteVersions.add(new PaletteVersion("26_10", Bedrock_v944.CODEC.getProtocolVersion()));
151+
paletteVersions.add(new PaletteVersion("26_20", Bedrock_v975.CODEC.getProtocolVersion(), "26_10"));
152+
paletteVersions.add(new PaletteVersion("26_30", Bedrock_v1001.CODEC.getProtocolVersion()));
153153

154154
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
155155

core/src/main/java/org/geysermc/geyser/registry/populator/TagRegistryPopulator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
import it.unimi.dsi.fastutil.ints.IntList;
3434
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
3535
import it.unimi.dsi.fastutil.objects.ObjectIntPair;
36-
import org.cloudburstmc.protocol.bedrock.codec.v898.Bedrock_v898;
36+
import org.cloudburstmc.protocol.bedrock.codec.v1001.Bedrock_v1001;
3737
import org.cloudburstmc.protocol.bedrock.codec.v924.Bedrock_v924;
3838
import org.cloudburstmc.protocol.bedrock.codec.v944.Bedrock_v944;
39+
import org.cloudburstmc.protocol.bedrock.codec.v975.Bedrock_v975;
3940
import org.geysermc.geyser.GeyserBootstrap;
4041
import org.geysermc.geyser.GeyserImpl;
4142
import org.geysermc.geyser.item.type.Item;
@@ -68,9 +69,10 @@ public boolean equals(int[] a, int[] b) {
6869
};
6970

7071
List<ObjectIntPair<String>> paletteVersions = List.of(
71-
ObjectIntPair.of("1_21_130", Bedrock_v898.CODEC.getProtocolVersion()),
72-
ObjectIntPair.of("1_26_0", Bedrock_v924.CODEC.getProtocolVersion()),
73-
ObjectIntPair.of("1_26_10", Bedrock_v944.CODEC.getProtocolVersion())
72+
ObjectIntPair.of("26_0", Bedrock_v924.CODEC.getProtocolVersion()),
73+
ObjectIntPair.of("26_10", Bedrock_v944.CODEC.getProtocolVersion()),
74+
ObjectIntPair.of("26_20", Bedrock_v975.CODEC.getProtocolVersion()),
75+
ObjectIntPair.of("26_30", Bedrock_v1001.CODEC.getProtocolVersion())
7476
);
7577
Type type = new TypeToken<Map<String, List<String>>>() {}.getType();
7678

core/src/main/java/org/geysermc/geyser/session/GeyserSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ private void startGame() {
18701870
this.upstream.getCodecHelper().setBlockDefinitions(this.blockMappings);
18711871
this.upstream.getCodecHelper().setCameraPresetDefinitions(CameraDefinitions.CAMERA_DEFINITIONS);
18721872

1873-
if (GameProtocol.is1_26_20orHigher(protocolVersion())) {
1873+
if (GameProtocol.is26_20orHigher(protocolVersion())) {
18741874
VoxelShapesPacket voxelShapesPacket = new VoxelShapesPacket();
18751875
voxelShapesPacket.setNameMap(new HashMap<>());
18761876
voxelShapesPacket.setShapes(new ArrayList<>());

core/src/main/java/org/geysermc/geyser/session/cache/waypoint/GeyserWaypoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ private void sendTrackPackets(boolean add) {
241241
}
242242

243243
public static boolean uses26_10WaypointPacket(GeyserSession session) {
244-
return GameProtocol.is1_26_10orHigher(session.protocolVersion());
244+
return GameProtocol.is26_10orHigher(session.protocolVersion());
245245
}
246246

247247
public static boolean uses26_20WaypointPacket(GeyserSession session) {
248-
return GameProtocol.is1_26_20orHigher(session.protocolVersion());
248+
return GameProtocol.is26_20orHigher(session.protocolVersion());
249249
}
250250

251251
private static Color getWaypointColor(TrackedWaypoint waypoint) {

core/src/main/java/org/geysermc/geyser/session/cache/waypoint/WaypointCache.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
public final class WaypointCache {
4545
private final GeyserSession session;
4646
private final Map<String, GeyserWaypoint> waypoints = new Object2ObjectOpenHashMap<>();
47-
// TODO: remove when dropping 1.26.0 and below
47+
// TODO: remove when dropping 26.0 and below
4848
private final Map<UUID, Color> waypointColors = new Object2ObjectOpenHashMap<>();
4949

5050
public WaypointCache(GeyserSession session) {
@@ -73,18 +73,18 @@ public void addEntity(Entity entity) {
7373

7474
GeyserWaypoint waypoint = waypoints.get(uuid.toString());
7575
if (waypoint != null) {
76-
// On 1.26.0 and below:
76+
// On 26.0 and below:
7777
// This will remove the fake player packet previously sent to the client,
7878
// and change the waypoint to use the player's entity ID instead.
7979
// This is important because sometimes a waypoint is sent before player info telling us to list the player, so a fake player packet is sent to the client
8080
// When the player becomes listed the right colour will already be used, this is always put in the colours map, no matter if the
8181
// player info existed or not
82-
// On 1.26.10 and above:
82+
// On 26.10 and above:
8383
// This will re-initialise the waypoint, adding the entity ID to it and letting the client take authority
8484
waypoint.setEntity(entity);
8585
} else {
8686
if (!GeyserWaypoint.uses26_10WaypointPacket(session)) {
87-
// On 1.26.0 and below:
87+
// On 26.0 and below:
8888
// If we haven't received a waypoint for the player, we need to tell the client to hide them
8989
// Bedrock likes to create their own waypoints for players in render distance, but Java doesn't do this, and we don't want this either, since it could
9090
// lead to duplicate/wrong waypoints on the locator bar
@@ -103,18 +103,18 @@ public void removeEntity(Entity entity) {
103103

104104
GeyserWaypoint waypoint = waypoints.get(uuid.toString());
105105
if (waypoint != null) {
106-
// On 1.26.0 and below:
106+
// On 26.0 and below:
107107
// This will remove the player packet previously sent to the client,
108108
// and change the waypoint to use the player's entity ID instead.
109109
// This is important because a player waypoint can still show even when a player becomes unlisted,
110110
// so a fake player packet has to be sent to the client now
111-
// On 1.26.10 and above:
111+
// On 26.10 and above:
112112
// This will re-initialise the waypoint, removing the entity ID from it and not letting the client take authority
113113
waypoint.setEntity(null);
114114
}
115115
}
116116

117-
// TODO: remove when dropping 1.26.0 and below
117+
// TODO: remove when dropping 26.0 and below
118118
public Optional<Color> getWaypointColor(UUID uuid) {
119119
return Optional.ofNullable(waypointColors.get(uuid));
120120
}
@@ -136,7 +136,7 @@ private void track(TrackedWaypoint waypoint) {
136136
GeyserWaypoint tracked = GeyserWaypoint.create(session, entity, waypoint);
137137
if (tracked != null) {
138138
uuid.ifPresent(id -> waypointColors.put(id, tracked.color()));
139-
// On 1.26.0 and below, resend player entry with new waypoint colour
139+
// On 26.0 and below, resend player entry with new waypoint colour
140140
entity.ifPresent(anEntity -> {
141141
if (!GeyserWaypoint.uses26_10WaypointPacket(session) && anEntity instanceof PlayerEntity player) {
142142
updatePlayerEntry(player);
@@ -148,7 +148,7 @@ private void track(TrackedWaypoint waypoint) {
148148
} else {
149149
entity.ifPresent(anEntity -> {
150150
if (!GeyserWaypoint.uses26_10WaypointPacket(session) && anEntity instanceof PlayerEntity) {
151-
// On 1.26.0 and below:
151+
// On 26.0 and below:
152152
// When tracked waypoint is null, the waypoint shouldn't show up on the locator bar (Java type is EMPTY)
153153
// If this waypoint is linked to a player, tell the bedrock client to hide it
154154
// If we don't do this bedrock will show the waypoint anyway when the player is in render distance (read comments above in trackPlayer)

core/src/main/java/org/geysermc/geyser/translator/level/block/entity/ShelfBlockEntityTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap
4848

4949
// Bedrock determines shelf item position by list index, so we must produce
5050
// a dense list with empty items for unoccupied slots.
51-
// Verified with BDS 1.26.0.2
51+
// Verified with BDS 26.0.2
5252
NbtMap[] items = new NbtMap[SLOT_COUNT];
5353
Arrays.fill(items, BedrockItemBuilder.EMPTY_ITEM);
5454

core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/input/BedrockPlayerAuthInputTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void translate(GeyserSession session, PlayerAuthInputPacket packet) {
7272
SessionPlayerEntity entity = session.getPlayerEntity();
7373

7474
session.setClientTicks(packet.getTick());
75-
session.setInClientPredictedVehicle(packet.getInputData().contains(PlayerAuthInputData.IN_CLIENT_PREDICTED_IN_VEHICLE) && entity.getVehicle() != null && GameProtocol.is1_26_10orHigher(session.protocolVersion()));
75+
session.setInClientPredictedVehicle(packet.getInputData().contains(PlayerAuthInputData.IN_CLIENT_PREDICTED_IN_VEHICLE) && entity.getVehicle() != null && GameProtocol.is26_10orHigher(session.protocolVersion()));
7676

7777
boolean wasJumping = session.getInputCache().wasJumping();
7878
session.getInputCache().processInputs(entity, packet);

0 commit comments

Comments
 (0)