Skip to content

Commit 39b67e2

Browse files
committed
25w15a
1 parent 30e2bad commit 39b67e2

File tree

17 files changed

+229
-7
lines changed

17 files changed

+229
-7
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundSetTimePacket;
130130
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundSoundPacket;
131131
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundTagQueryPacket;
132+
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundTrackedWaypointPacket;
132133
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.border.ClientboundInitializeBorderPacket;
133134
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderCenterPacket;
134135
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.border.ClientboundSetBorderLerpSizePacket;
@@ -218,8 +219,8 @@
218219

219220
public class MinecraftCodec {
220221
public static final PacketCodec CODEC = PacketCodec.builder()
221-
.protocolVersion(770)
222-
.minecraftVersion("1.21.5")
222+
.protocolVersion((1 << 30) | 245)
223+
.minecraftVersion("25w15a")
223224
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
224225
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
225226
)
@@ -398,6 +399,7 @@ public class MinecraftCodec {
398399
.registerClientboundPacket(ClientboundProjectilePowerPacket.class, ClientboundProjectilePowerPacket::new)
399400
.registerClientboundPacket(ClientboundCustomReportDetailsPacket.class, ClientboundCustomReportDetailsPacket::new)
400401
.registerClientboundPacket(ClientboundServerLinksPacket.class, ClientboundServerLinksPacket::new)
402+
.registerClientboundPacket(ClientboundTrackedWaypointPacket.class, ClientboundTrackedWaypointPacket::new)
401403
.registerServerboundPacket(ServerboundAcceptTeleportationPacket.class, ServerboundAcceptTeleportationPacket::new)
402404
.registerServerboundPacket(ServerboundBlockEntityTagQueryPacket.class, ServerboundBlockEntityTagQueryPacket::new)
403405
.registerServerboundPacket(ServerboundSelectBundleItemPacket.class, ServerboundSelectBundleItemPacket::new)

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/command/CommandParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public enum CommandParser {
1818
ITEM_STACK,
1919
ITEM_PREDICATE,
2020
COLOR,
21+
HEX_COLOR,
2122
COMPONENT,
2223
STYLE,
2324
MESSAGE,

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/entity/attribute/AttributeType.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ enum Builtin implements AttributeType {
4040
BLOCK_BREAK_SPEED("minecraft:block_break_speed", 1, 0, 1024),
4141
BLOCK_INTERACTION_RANGE("minecraft:block_interaction_range", 4.5, 0, 64),
4242
BURNING_TIME("minecraft:burning_time", 1, 0, 1024),
43+
CAMERA_DISTANCE("minecraft:camera_distance", 4, 0, 32),
4344
EXPLOSION_KNOCKBACK_RESISTANCE("minecraft:explosion_knockback_resistance", 0, 0, 1),
4445
ENTITY_INTERACTION_RANGE("minecraft:entity_interaction_range", 3, 0, 64),
4546
FALL_DAMAGE_MULTIPLIER("minecraft:fall_damage_multiplier", 1, 0, 100),
@@ -63,7 +64,9 @@ enum Builtin implements AttributeType {
6364
SUBMERGED_MINING_SPEED("minecraft:submerged_mining_speed", 0.2, 0, 20),
6465
SWEEPING_DAMAGE_RATIO("minecraft:sweeping_damage_ratio", 0, 0, 1),
6566
TEMPT_RANGE("minecraft:tempt_range", 10, 0, 2048),
66-
WATER_MOVEMENT_EFFICIENCY("minecraft:water_movement_efficiency", 0, 0, 1);
67+
WATER_MOVEMENT_EFFICIENCY("minecraft:water_movement_efficiency", 0, 0, 1),
68+
WAYPOINT_TRANSMIT_RANGE("minecraft:waypoint_transmit_range", 0, 0, 6.0E7),
69+
WAYPOINT_RECEIVE_RANGE("minecraft:waypoint_receive_range", 0, 0, 6.0E7);
6770

6871
private final Key identifier;
6972
private final double def;

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/entity/type/EntityType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public enum EntityType {
5959
FROG,
6060
FURNACE_MINECART,
6161
GHAST,
62+
HAPPY_GHAST,
6263
GIANT,
6364
GLOW_ITEM_FRAME,
6465
GLOW_SQUID,

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import lombok.Data;
66
import lombok.With;
77
import net.kyori.adventure.key.Key;
8+
import net.kyori.adventure.text.Component;
89
import org.geysermc.mcprotocollib.protocol.data.game.entity.attribute.ModifierOperation;
10+
import org.jetbrains.annotations.Nullable;
911

1012
import java.util.List;
1113

@@ -25,6 +27,7 @@ public static class Entry {
2527
private final int attribute;
2628
private final AttributeModifier modifier;
2729
private final EquipmentSlotGroup slot;
30+
private final Display display;
2831
}
2932

3033
@Data
@@ -36,6 +39,14 @@ public static class AttributeModifier {
3639
private final ModifierOperation operation;
3740
}
3841

42+
@Data
43+
@Builder(toBuilder = true)
44+
@AllArgsConstructor
45+
public static class Display {
46+
DisplayType type;
47+
@Nullable Component component;
48+
}
49+
3950
public enum EquipmentSlotGroup {
4051
ANY,
4152
MAIN_HAND,
@@ -55,4 +66,16 @@ public static EquipmentSlotGroup from(int id) {
5566
return VALUES[id];
5667
}
5768
}
69+
70+
public enum DisplayType {
71+
DEFAULT,
72+
HIDDEN,
73+
OVERRIDE;
74+
75+
private static final DisplayType[] VALUES = values();
76+
77+
public static DisplayType from(int id) {
78+
return id >= 0 && id < VALUES.length ? VALUES[id] : VALUES[0];
79+
}
80+
}
5881
}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,15 @@ public static ItemAttributeModifiers readItemAttributeModifiers(ByteBuf buf) {
235235
ItemAttributeModifiers.AttributeModifier modifier = new ItemAttributeModifiers.AttributeModifier(id, amount, operation);
236236

237237
ItemAttributeModifiers.EquipmentSlotGroup slot = ItemAttributeModifiers.EquipmentSlotGroup.from(MinecraftTypes.readVarInt(input));
238-
return new ItemAttributeModifiers.Entry(attribute, modifier, slot);
238+
239+
ItemAttributeModifiers.DisplayType displayType = ItemAttributeModifiers.DisplayType.from(MinecraftTypes.readVarInt(buf));
240+
Component overrideText = null;
241+
if (displayType == ItemAttributeModifiers.DisplayType.OVERRIDE) {
242+
overrideText = MinecraftTypes.readComponent(buf);
243+
}
244+
ItemAttributeModifiers.Display display = new ItemAttributeModifiers.Display(displayType, overrideText);
245+
246+
return new ItemAttributeModifiers.Entry(attribute, modifier, slot, display);
239247
});
240248

241249
return new ItemAttributeModifiers(modifiers);
@@ -248,6 +256,10 @@ public static void writeItemAttributeModifiers(ByteBuf buf, ItemAttributeModifie
248256
output.writeDouble(entry.getModifier().getAmount());
249257
MinecraftTypes.writeVarInt(output, entry.getModifier().getOperation().ordinal());
250258
MinecraftTypes.writeVarInt(output, entry.getSlot().ordinal());
259+
MinecraftTypes.writeVarInt(output, entry.getDisplay().getType().ordinal());
260+
if (entry.getDisplay().getType() == ItemAttributeModifiers.DisplayType.OVERRIDE) {
261+
MinecraftTypes.writeComponent(output, entry.getDisplay().getComponent());
262+
}
251263
});
252264
}
253265

protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/game/level/sound/BuiltinSound.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,21 @@ public enum BuiltinSound implements Sound {
459459
ENTITY_DONKEY_EAT("entity.donkey.eat"),
460460
ENTITY_DONKEY_HURT("entity.donkey.hurt"),
461461
ENTITY_DONKEY_JUMP("entity.donkey.jump"),
462+
BLOCK_DRIED_GHAST_BREAK("block.dried_ghast.break"),
463+
BLOCK_DRIED_GHAST_STEP("block.dried_ghast.step"),
464+
BLOCK_DRIED_GHAST_FALL("block.dried_ghast.fall"),
465+
BLOCK_DRIED_GHAST_HIT("block.dried_ghast.hit"),
466+
BLOCK_DRIED_GHAST_AMBIENT("block.dried_ghast.ambient"),
467+
BLOCK_DRIED_GHAST_AMBIENT_WATER("block.dried_ghast.ambient_water"),
468+
BLOCK_DRIED_GHAST_PLACE("block.dried_ghast.place"),
469+
BLOCK_DRIED_GHAST_PLACE_IN_WATER("block.dried_ghast.place_in_water"),
470+
BLOCK_DRIED_GHAST_TRANSITION("block.dried_ghast.transition"),
462471
BLOCK_DRIPSTONE_BLOCK_BREAK("block.dripstone_block.break"),
463472
BLOCK_DRIPSTONE_BLOCK_STEP("block.dripstone_block.step"),
464473
BLOCK_DRIPSTONE_BLOCK_PLACE("block.dripstone_block.place"),
465474
BLOCK_DRIPSTONE_BLOCK_HIT("block.dripstone_block.hit"),
466475
BLOCK_DRIPSTONE_BLOCK_FALL("block.dripstone_block.fall"),
476+
BLOCK_DRY_GRASS_AMBIENT("block.dry_grass.ambient"),
467477
BLOCK_POINTED_DRIPSTONE_BREAK("block.pointed_dripstone.break"),
468478
BLOCK_POINTED_DRIPSTONE_STEP("block.pointed_dripstone.step"),
469479
BLOCK_POINTED_DRIPSTONE_PLACE("block.pointed_dripstone.place"),
@@ -625,6 +635,10 @@ public enum BuiltinSound implements Sound {
625635
ENTITY_GHAST_SCREAM("entity.ghast.scream"),
626636
ENTITY_GHAST_SHOOT("entity.ghast.shoot"),
627637
ENTITY_GHAST_WARN("entity.ghast.warn"),
638+
ENTITY_GHASTLING_AMBIENT("entity.ghastling.ambient"),
639+
ENTITY_GHASTLING_DEATH("entity.ghastling.death"),
640+
ENTITY_GHASTLING_HURT("entity.ghastling.hurt"),
641+
ENTITY_GHASTLING_SPAWN("entity.ghastling.spawn"),
628642
BLOCK_GILDED_BLACKSTONE_BREAK("block.gilded_blackstone.break"),
629643
BLOCK_GILDED_BLACKSTONE_FALL("block.gilded_blackstone.fall"),
630644
BLOCK_GILDED_BLACKSTONE_HIT("block.gilded_blackstone.hit"),
@@ -693,6 +707,10 @@ public enum BuiltinSound implements Sound {
693707
BLOCK_HANGING_SIGN_FALL("block.hanging_sign.fall"),
694708
BLOCK_HANGING_SIGN_HIT("block.hanging_sign.hit"),
695709
BLOCK_HANGING_SIGN_PLACE("block.hanging_sign.place"),
710+
ENTITY_HAPPY_GHAST_AMBIENT("entity.happy_ghast.ambient"),
711+
ENTITY_HAPPY_GHAST_DEATH("entity.happy_ghast.death"),
712+
ENTITY_HAPPY_GHAST_HURT("entity.happy_ghast.hurt"),
713+
ENTITY_HAPPY_GHAST_RIDING("entity.happy_ghast.riding"),
696714
BLOCK_HEAVY_CORE_BREAK("block.heavy_core.break"),
697715
BLOCK_HEAVY_CORE_FALL("block.heavy_core.fall"),
698716
BLOCK_HEAVY_CORE_HIT("block.heavy_core.hit"),
@@ -724,6 +742,10 @@ public enum BuiltinSound implements Sound {
724742
BLOCK_TRIAL_SPAWNER_OPEN_SHUTTER("block.trial_spawner.open_shutter"),
725743
BLOCK_TRIAL_SPAWNER_CLOSE_SHUTTER("block.trial_spawner.close_shutter"),
726744
BLOCK_TRIAL_SPAWNER_EJECT_ITEM("block.trial_spawner.eject_item"),
745+
ENTITY_HAPPY_GHAST_EQUIP("entity.happy_ghast.equip"),
746+
ENTITY_HAPPY_GHAST_UNEQUIP("entity.happy_ghast.unequip"),
747+
ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_UP("entity.happy_ghast.harness_goggles_up"),
748+
ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_DOWN("entity.happy_ghast.harness_goggles_down"),
727749
ITEM_HOE_TILL("item.hoe.till"),
728750
ENTITY_HOGLIN_AMBIENT("entity.hoglin.ambient"),
729751
ENTITY_HOGLIN_ANGRY("entity.hoglin.angry"),
@@ -1238,7 +1260,6 @@ public enum BuiltinSound implements Sound {
12381260
BLOCK_SAND_PLACE("block.sand.place"),
12391261
BLOCK_SAND_STEP("block.sand.step"),
12401262
BLOCK_SAND_IDLE("block.sand.idle"),
1241-
BLOCK_SAND_WIND("block.sand.wind"),
12421263
BLOCK_SCAFFOLDING_BREAK("block.scaffolding.break"),
12431264
BLOCK_SCAFFOLDING_FALL("block.scaffolding.fall"),
12441265
BLOCK_SCAFFOLDING_HIT("block.scaffolding.hit"),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package org.geysermc.mcprotocollib.protocol.data.game.level.waypoint;
2+
3+
public record AzimuthWaypointData(float angle) implements WaypointData {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package org.geysermc.mcprotocollib.protocol.data.game.level.waypoint;
2+
3+
public record ChunkWaypointData(int chunkX, int chunkZ) implements WaypointData {
4+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.geysermc.mcprotocollib.protocol.data.game.level.waypoint;
2+
3+
import org.jetbrains.annotations.Nullable;
4+
5+
import java.util.Optional;
6+
import java.util.UUID;
7+
8+
public record TrackedWaypoint(@Nullable UUID uuid, @Nullable String id, Icon icon, Type type, @Nullable WaypointData data) {
9+
10+
public record Fade(int nearDist, int farDist, float nearAlpha, float farAlpha) {
11+
}
12+
13+
public record Icon(Fade alphaFade, Optional<Integer> color) {
14+
}
15+
16+
public enum Type {
17+
EMPTY,
18+
VEC3I,
19+
CHUNK,
20+
AZIMUTH;
21+
22+
private static final Type[] VALUES = values();
23+
24+
public static Type from(int id) {
25+
return VALUES[id];
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)