Skip to content

Commit 24f774e

Browse files
1.21.70 support (#5414)
* Initial work on 1.21.70 * Update mappings, fixup jitpack * Use LevelSoundEventPacket instead of LevelSoundEvent2Packet, ensure only temperate cow/pig/chicken/thrown egg entities spawn, update item components * Update cloudburst/protocol dependency, target master mappings branch
1 parent 69329f2 commit 24f774e

32 files changed

+21655
-912
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
1515
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
1616

1717
## Supported Versions
18-
Geyser is currently supporting Minecraft Bedrock 1.21.40 - 1.21.62 and Minecraft Java 1.21.4. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
18+
Geyser is currently supporting Minecraft Bedrock 1.21.40 - 1.21.70 and Minecraft Java 1.21.4. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/).
1919

2020
## Setting Up
2121
Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser.

build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ repositories {
6262
name = "viaversion"
6363
}
6464

65+
// For Adventure snapshots
66+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
67+
6568
// Jitpack for e.g. MCPL
6669
maven("https://jitpack.io") {
6770
content { includeGroupByRegex("com\\.github\\..*") }
6871
}
6972

70-
// For Adventure snapshots
71-
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
7273
}

core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes;
2929
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
3030
import org.geysermc.geyser.entity.factory.EntityFactory;
31-
import org.geysermc.geyser.entity.properties.GeyserEntityProperties;
31+
import org.geysermc.geyser.entity.properties.VanillaEntityProperties;
3232
import org.geysermc.geyser.entity.type.AbstractArrowEntity;
3333
import org.geysermc.geyser.entity.type.AbstractWindChargeEntity;
3434
import org.geysermc.geyser.entity.type.AreaEffectCloudEntity;
@@ -462,6 +462,7 @@ public final class EntityDefinitions {
462462
EGG = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase)
463463
.type(EntityType.EGG)
464464
.heightAndWidth(0.25f)
465+
.properties(VanillaEntityProperties.CLIMATE_VARIANT)
465466
.build();
466467
ENDER_PEARL = EntityDefinition.inherited(ThrowableItemEntity::new, throwableItemBase)
467468
.type(EntityType.ENDER_PEARL)
@@ -685,15 +686,7 @@ public final class EntityDefinitions {
685686
.addTranslator(MetadataTypes.BOOLEAN, CreakingEntity::setActive)
686687
.addTranslator(MetadataTypes.BOOLEAN, CreakingEntity::setIsTearingDown)
687688
.addTranslator(MetadataTypes.OPTIONAL_POSITION, CreakingEntity::setHomePos)
688-
.properties(new GeyserEntityProperties.Builder()
689-
.addEnum(CreakingEntity.CREAKING_STATE,
690-
"neutral",
691-
"hostile_observed",
692-
"hostile_unobserved",
693-
"twitching",
694-
"crumbling")
695-
.addInt(CreakingEntity.CREAKING_SWAYING_TICKS, 0, 6)
696-
.build())
689+
.properties(VanillaEntityProperties.CREAKING)
697690
.build();
698691
CREEPER = EntityDefinition.inherited(CreeperEntity::new, mobEntityBase)
699692
.type(EntityType.CREEPER)
@@ -946,15 +939,7 @@ public final class EntityDefinitions {
946939
ARMADILLO = EntityDefinition.inherited(ArmadilloEntity::new, ageableEntityBase)
947940
.type(EntityType.ARMADILLO)
948941
.height(0.65f).width(0.7f)
949-
.properties(new GeyserEntityProperties.Builder()
950-
.addEnum(
951-
"minecraft:armadillo_state",
952-
"unrolled",
953-
"rolled_up",
954-
"rolled_up_peeking",
955-
"rolled_up_relaxing",
956-
"rolled_up_unrolling")
957-
.build())
942+
.properties(VanillaEntityProperties.ARMADILLO)
958943
.addTranslator(MetadataTypes.ARMADILLO_STATE, ArmadilloEntity::setArmadilloState)
959944
.build();
960945
AXOLOTL = EntityDefinition.inherited(AxolotlEntity::new, ageableEntityBase)
@@ -967,19 +952,19 @@ public final class EntityDefinitions {
967952
BEE = EntityDefinition.inherited(BeeEntity::new, ageableEntityBase)
968953
.type(EntityType.BEE)
969954
.heightAndWidth(0.6f)
970-
.properties(new GeyserEntityProperties.Builder()
971-
.addBoolean("minecraft:has_nectar")
972-
.build())
955+
.properties(VanillaEntityProperties.BEE)
973956
.addTranslator(MetadataTypes.BYTE, BeeEntity::setBeeFlags)
974957
.addTranslator(MetadataTypes.INT, BeeEntity::setAngerTime)
975958
.build();
976959
CHICKEN = EntityDefinition.inherited(ChickenEntity::new, ageableEntityBase)
977960
.type(EntityType.CHICKEN)
978961
.height(0.7f).width(0.4f)
962+
.properties(VanillaEntityProperties.CLIMATE_VARIANT)
979963
.build();
980964
COW = EntityDefinition.inherited(CowEntity::new, ageableEntityBase)
981965
.type(EntityType.COW)
982966
.height(1.4f).width(0.9f)
967+
.properties(VanillaEntityProperties.CLIMATE_VARIANT)
983968
.build();
984969
FOX = EntityDefinition.inherited(FoxEntity::new, ageableEntityBase)
985970
.type(EntityType.FOX)
@@ -1030,6 +1015,7 @@ public final class EntityDefinitions {
10301015
PIG = EntityDefinition.inherited(PigEntity::new, ageableEntityBase)
10311016
.type(EntityType.PIG)
10321017
.heightAndWidth(0.9f)
1018+
.properties(VanillaEntityProperties.CLIMATE_VARIANT)
10331019
.addTranslator(MetadataTypes.BOOLEAN, (pigEntity, entityMetadata) -> pigEntity.setFlag(EntityFlag.SADDLED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue()))
10341020
.addTranslator(MetadataTypes.INT, PigEntity::setBoost)
10351021
.build();
@@ -1176,6 +1162,7 @@ public final class EntityDefinitions {
11761162
WOLF = EntityDefinition.inherited(WolfEntity::new, tameableEntityBase)
11771163
.type(EntityType.WOLF)
11781164
.height(0.85f).width(0.6f)
1165+
.properties(VanillaEntityProperties.WOLF_SOUND_VARIANT)
11791166
// "Begging" on wiki.vg, "Interested" in Nukkit - the tilt of the head
11801167
.addTranslator(MetadataTypes.BOOLEAN, (wolfEntity, entityMetadata) -> wolfEntity.setFlag(EntityFlag.INTERESTED, ((BooleanEntityMetadata) entityMetadata).getPrimitiveValue()))
11811168
.addTranslator(MetadataTypes.INT, WolfEntity::setCollarColor)

core/src/main/java/org/geysermc/geyser/entity/properties/GeyserEntityProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ public GeyserEntityProperties build() {
162162
return new GeyserEntityProperties(properties, propertyIndices);
163163
}
164164
}
165-
}
165+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (c) 2025 GeyserMC. http://geysermc.org
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
* THE SOFTWARE.
21+
*
22+
* @author GeyserMC
23+
* @link https://github.com/GeyserMC/Geyser
24+
*/
25+
26+
package org.geysermc.geyser.entity.properties;
27+
28+
import org.geysermc.geyser.entity.type.living.monster.CreakingEntity;
29+
30+
public class VanillaEntityProperties {
31+
32+
public static final String CLIMATE_VARIANT_ID = "minecraft:climate_variant";
33+
34+
public static final GeyserEntityProperties ARMADILLO = new GeyserEntityProperties.Builder()
35+
.addEnum("minecraft:armadillo_state",
36+
"unrolled",
37+
"rolled_up",
38+
"rolled_up_peeking",
39+
"rolled_up_relaxing",
40+
"rolled_up_unrolling")
41+
.build();
42+
43+
public static final GeyserEntityProperties BEE = new GeyserEntityProperties.Builder()
44+
.addBoolean("minecraft:has_nectar")
45+
.build();
46+
47+
public static final GeyserEntityProperties CLIMATE_VARIANT = new GeyserEntityProperties.Builder()
48+
.addEnum(CLIMATE_VARIANT_ID,
49+
"temperate",
50+
"warm",
51+
"cold")
52+
.build();
53+
54+
public static final GeyserEntityProperties CREAKING = new GeyserEntityProperties.Builder()
55+
.addEnum(CreakingEntity.CREAKING_STATE,
56+
"neutral",
57+
"hostile_observed",
58+
"hostile_unobserved",
59+
"twitching",
60+
"crumbling")
61+
.addInt(CreakingEntity.CREAKING_SWAYING_TICKS, 0, 6)
62+
.build();
63+
64+
public static final GeyserEntityProperties WOLF_SOUND_VARIANT = new GeyserEntityProperties.Builder()
65+
.addEnum("minecraft:sound_variant",
66+
"default",
67+
"big",
68+
"cute",
69+
"grumpy",
70+
"mad",
71+
"puglin",
72+
"sad")
73+
.build();
74+
}

core/src/main/java/org/geysermc/geyser/entity/type/BoatEntity.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import lombok.Getter;
2929
import org.cloudburstmc.math.vector.Vector3f;
3030
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes;
31+
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
3132
import org.cloudburstmc.protocol.bedrock.packet.AnimatePacket;
3233
import org.cloudburstmc.protocol.bedrock.packet.MoveEntityAbsolutePacket;
3334
import org.geysermc.geyser.entity.EntityDefinition;
@@ -85,7 +86,14 @@ public BoatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid,
8586

8687
// Required to be able to move on land 1.16.200+ or apply gravity not in the water 1.16.100+
8788
dirtyMetadata.put(EntityDataTypes.IS_BUOYANT, true);
88-
dirtyMetadata.put(EntityDataTypes.BUOYANCY_DATA, BUOYANCY_DATA);
89+
dirtyMetadata.put(EntityDataTypes.BUOYANCY_DATA, BUOYANCY_DATA);;
90+
}
91+
92+
@Override
93+
protected void initializeMetadata() {
94+
super.initializeMetadata();
95+
// Without this flag you cant stand on boats
96+
setFlag(EntityFlag.COLLIDABLE, true);
8997
}
9098

9199
@Override

core/src/main/java/org/geysermc/geyser/entity/type/Entity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public void spawnEntity() {
200200
addAdditionalSpawnData(addEntityPacket);
201201

202202
valid = true;
203+
203204
session.sendUpstreamPacket(addEntityPacket);
204205

205206
flagsDirty = false;
@@ -372,6 +373,10 @@ public void updateBedrockMetadata() {
372373
flagsDirty = false;
373374
}
374375
dirtyMetadata.apply(entityDataPacket.getMetadata());
376+
if (propertyManager != null && propertyManager.hasProperties()) {
377+
propertyManager.applyIntProperties(entityDataPacket.getProperties().getIntProperties());
378+
propertyManager.applyFloatProperties(entityDataPacket.getProperties().getFloatProperties());
379+
}
375380
session.sendUpstreamPacket(entityDataPacket);
376381
}
377382
}

core/src/main/java/org/geysermc/geyser/entity/type/ThrowableItemEntity.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
import org.cloudburstmc.math.vector.Vector3f;
2929
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataTypes;
3030
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
31+
import org.cloudburstmc.protocol.bedrock.packet.AddEntityPacket;
3132
import org.geysermc.geyser.entity.EntityDefinition;
3233
import org.geysermc.geyser.entity.EntityDefinitions;
34+
import org.geysermc.geyser.entity.properties.VanillaEntityProperties;
3335
import org.geysermc.geyser.session.GeyserSession;
3436
import org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata;
37+
import org.geysermc.mcprotocollib.protocol.data.game.entity.type.EntityType;
3538
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
3639

3740
import java.util.UUID;
@@ -53,6 +56,14 @@ public ThrowableItemEntity(GeyserSession session, int entityId, long geyserId, U
5356
age = 0;
5457
}
5558

59+
@Override
60+
public void addAdditionalSpawnData(AddEntityPacket addEntityPacket) {
61+
if (definition.entityType() == EntityType.EGG) {
62+
propertyManager.add(VanillaEntityProperties.CLIMATE_VARIANT_ID, "temperate");
63+
propertyManager.applyIntProperties(addEntityPacket.getProperties().getIntProperties());
64+
}
65+
}
66+
5667
@Override
5768
protected void initializeMetadata() {
5869
super.initializeMetadata();

core/src/main/java/org/geysermc/geyser/entity/type/living/animal/ChickenEntity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727

2828
import org.checkerframework.checker.nullness.qual.Nullable;
2929
import org.cloudburstmc.math.vector.Vector3f;
30+
import org.cloudburstmc.protocol.bedrock.packet.AddEntityPacket;
3031
import org.geysermc.geyser.entity.EntityDefinition;
32+
import org.geysermc.geyser.entity.properties.VanillaEntityProperties;
3133
import org.geysermc.geyser.item.type.Item;
3234
import org.geysermc.geyser.session.GeyserSession;
3335
import org.geysermc.geyser.session.cache.tags.ItemTag;
@@ -41,6 +43,12 @@ public ChickenEntity(GeyserSession session, int entityId, long geyserId, UUID uu
4143
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
4244
}
4345

46+
@Override
47+
public void addAdditionalSpawnData(AddEntityPacket addEntityPacket) {
48+
propertyManager.add(VanillaEntityProperties.CLIMATE_VARIANT_ID, "temperate");
49+
propertyManager.applyIntProperties(addEntityPacket.getProperties().getIntProperties());
50+
}
51+
4452
@Override
4553
@Nullable
4654
protected Tag<Item> getFoodTag() {

core/src/main/java/org/geysermc/geyser/entity/type/living/animal/CowEntity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
import org.cloudburstmc.math.vector.Vector3f;
3131
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
3232
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
33+
import org.cloudburstmc.protocol.bedrock.packet.AddEntityPacket;
3334
import org.geysermc.geyser.entity.EntityDefinition;
35+
import org.geysermc.geyser.entity.properties.VanillaEntityProperties;
3436
import org.geysermc.geyser.inventory.GeyserItemStack;
3537
import org.geysermc.geyser.item.Items;
3638
import org.geysermc.geyser.item.type.Item;
@@ -48,6 +50,12 @@ public CowEntity(GeyserSession session, int entityId, long geyserId, UUID uuid,
4850
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
4951
}
5052

53+
@Override
54+
public void addAdditionalSpawnData(AddEntityPacket addEntityPacket) {
55+
propertyManager.add(VanillaEntityProperties.CLIMATE_VARIANT_ID, "temperate");
56+
propertyManager.applyIntProperties(addEntityPacket.getProperties().getIntProperties());
57+
}
58+
5159
@NonNull
5260
@Override
5361
protected InteractiveTag testMobInteraction(@NonNull Hand hand, @NonNull GeyserItemStack itemInHand) {

0 commit comments

Comments
 (0)