Skip to content

Commit 47f3f05

Browse files
committed
24w37a
1 parent 7f7445f commit 47f3f05

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/codec/MinecraftCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@
210210

211211
public class MinecraftCodec {
212212
public static final PacketCodec CODEC = PacketCodec.builder()
213-
.protocolVersion((1 << 30) | 208)
213+
.protocolVersion((1 << 30) | 209)
214214
.helper(MinecraftCodecHelper::new)
215-
.minecraftVersion("24w36a")
215+
.minecraftVersion("24w37a")
216216
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
217217
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
218218
)

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/item/component/DataComponentType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ public class DataComponentType<T> {
4646
public static final DataComponentType<Consumable> CONSUMABLE = new DataComponentType<>(ItemCodecHelper::readConsumable, ItemCodecHelper::writeConsumable, ObjectDataComponent::new);
4747
public static final DataComponentType<ItemStack> USE_REMAINDER = new DataComponentType<>(ItemCodecHelper::readItemStack, ItemCodecHelper::writeItemStack, ObjectDataComponent::new);
4848
public static final DataComponentType<UseCooldown> USE_COOLDOWN = new DataComponentType<>(ItemCodecHelper::readUseCooldown, ItemCodecHelper::writeUseCooldown, ObjectDataComponent::new);
49-
public static final DataComponentType<Unit> FIRE_RESISTANT = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new);
49+
public static final DataComponentType<Key> DAMAGE_RESISTANT = new DataComponentType<>(ItemCodecHelper::readResourceLocation, ItemCodecHelper::writeResourceLocation, ObjectDataComponent::new);
5050
public static final DataComponentType<ToolData> TOOL = new DataComponentType<>(ItemCodecHelper::readToolData, ItemCodecHelper::writeToolData, ObjectDataComponent::new);
5151
public static final IntComponentType ENCHANTABLE = new IntComponentType(ItemCodecHelper::readVarInt, ItemCodecHelper::writeVarInt, IntDataComponent::new);
5252
public static final DataComponentType<Equippable> EQUIPPABLE = new DataComponentType<>(ItemCodecHelper::readEquippable, ItemCodecHelper::writeEquippable, ObjectDataComponent::new);
5353
public static final DataComponentType<HolderSet> REPAIRABLE = new DataComponentType<>(ItemCodecHelper::readHolderSet, ItemCodecHelper::writeHolderSet, ObjectDataComponent::new);
5454
public static final DataComponentType<Unit> GLIDER = new DataComponentType<>(unitReader(), unitWriter(), ObjectDataComponent::new);
5555
public static final DataComponentType<Key> TOOLTIP_STYLE = new DataComponentType<>(ItemCodecHelper::readResourceLocation, ItemCodecHelper::writeResourceLocation, ObjectDataComponent::new);
56+
public static final DataComponentType<List<ConsumeEffect>> DEATH_PROTECTION = new DataComponentType<>(listReader(ItemCodecHelper::readConsumeEffect), listWriter(ItemCodecHelper::writeConsumeEffect), ObjectDataComponent::new);
5657
public static final DataComponentType<ItemEnchantments> STORED_ENCHANTMENTS = new DataComponentType<>(ItemCodecHelper::readItemEnchantments, ItemCodecHelper::writeItemEnchantments, ObjectDataComponent::new);
5758
public static final DataComponentType<DyedItemColor> DYED_COLOR = new DataComponentType<>(ItemCodecHelper::readDyedItemColor, ItemCodecHelper::writeDyedItemColor, ObjectDataComponent::new);
5859
public static final IntComponentType MAP_COLOR = new IntComponentType((helper, input) -> input.readInt(), (helper, output, value) -> output.writeInt(value), IntDataComponent::new);

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/ingame/clientbound/entity/player/ClientboundPlayerPositionPacket.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public ClientboundPlayerPositionPacket(ByteBuf in, MinecraftCodecHelper helper)
3333
this.id = helper.readVarInt(in);
3434
this.position = Vector3d.from(in.readDouble(), in.readDouble(), in.readDouble());
3535
this.deltaMovement = Vector3d.from(in.readDouble(), in.readDouble(), in.readDouble());
36-
this.yRot = in.readByte() * 360 / 256F;
37-
this.xRot = in.readByte() * 360 / 256F;
36+
this.yRot = in.readFloat();
37+
this.xRot = in.readFloat();
3838

3939
this.relativeArguments = new ArrayList<>();
4040
int flags = in.readInt();
@@ -56,11 +56,8 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) {
5656
out.writeDouble(this.deltaMovement.getX());
5757
out.writeDouble(this.deltaMovement.getY());
5858
out.writeDouble(this.deltaMovement.getZ());
59-
60-
float yRot = this.yRot * 256F / 360F;
61-
out.writeByte(yRot < (int)yRot ? (int)yRot - 1 : (int)yRot);
62-
float xRot = this.xRot * 256F / 360F;
63-
out.writeByte(xRot < (int)xRot ? (int)xRot - 1 : (int)xRot);
59+
out.writeFloat(this.yRot);
60+
out.writeFloat(this.xRot);
6461

6562
int flags = 0;
6663
for (PositionElement element : this.relativeArguments) {

0 commit comments

Comments
 (0)