9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-28 03:19:14 +00:00

初步添加playerinfo所需的类

This commit is contained in:
XiaoMoMi
2025-04-12 00:24:17 +08:00
parent b1f63d8a31
commit 727ffca814
6 changed files with 27 additions and 5 deletions

View File

@@ -37,4 +37,6 @@ public interface PacketIds {
int clientboundSetObjectivePacket();
int clientboundLevelChunkWithLightPacket();
int clientboundPlayerInfoUpdatePacket();
}

View File

@@ -94,4 +94,9 @@ public class PacketIds1_20 implements PacketIds {
public int clientboundLevelChunkWithLightPacket() {
return PacketIdFinder.clientboundByClazz(Reflections.clazz$ClientboundLevelChunkWithLightPacket);
}
@Override
public int clientboundPlayerInfoUpdatePacket() {
return PacketIdFinder.clientboundByClazz(Reflections.clazz$clientboundplayer);
}
}

View File

@@ -93,4 +93,9 @@ public class PacketIds1_20_5 implements PacketIds {
public int clientboundLevelChunkWithLightPacket() {
return PacketIdFinder.clientboundByName("minecraft:level_chunk_with_light");
}
@Override
public int clientboundPlayerInfoUpdatePacket() {
return PacketIdFinder.clientboundByName("minecraft:player_info_update");
}
}

View File

@@ -1745,6 +1745,12 @@ public class Reflections {
)
);
public static final Class<?> clazz$ClientboundPlayerInfoUpdatePacket = requireNonNull(
ReflectionUtils.getClazz(
BukkitReflectionUtils.assembleMCClass("network.protocol.game.ClientboundPlayerInfoUpdatePacket")
)
);
public static final Field field$ClientboundLevelChunkWithLightPacket$chunkData = requireNonNull(
ReflectionUtils.getDeclaredField(
clazz$ClientboundLevelChunkWithLightPacket, clazz$ClientboundLevelChunkPacketData, 0