Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-23 23:00:13 +01:00
Merge pull request #1479 from KennyTV/dev
Fix an error in the player spawn packet
Dieser Commit ist enthalten in:
Commit
232f2494e3
@ -60,27 +60,28 @@ public class EntityPackets {
|
||||
protocol.registerOutgoing(State.PLAY, 0x03, 0x03, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
map(Type.UUID); // 1 - Entity UUID
|
||||
map(Type.VAR_INT); // 2 - Entity Type
|
||||
map(Type.DOUBLE); // 3 - X
|
||||
map(Type.DOUBLE); // 4 - Y
|
||||
map(Type.DOUBLE); // 5 - Z
|
||||
map(Type.BYTE); // 6 - Yaw
|
||||
map(Type.BYTE); // 7 - Pitch
|
||||
map(Type.BYTE); // 8 - Head Pitch
|
||||
map(Type.SHORT); // 9 - Velocity X
|
||||
map(Type.SHORT); // 10 - Velocity Y
|
||||
map(Type.SHORT); // 11 - Velocity Z
|
||||
map(Types1_14.METADATA_LIST, Type.NOTHING); // removed - probably sent in an update packet?
|
||||
|
||||
handler(new PacketHandler() {
|
||||
@Override
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
int entityId = wrapper.passthrough(Type.VAR_INT);
|
||||
wrapper.passthrough(Type.UUID);
|
||||
|
||||
int typeId = wrapper.read(Type.VAR_INT);
|
||||
int entityId = wrapper.get(Type.VAR_INT, 0);
|
||||
int typeId = wrapper.get(Type.VAR_INT, 1);
|
||||
Entity1_15Types.EntityType entityType = Entity1_15Types.getTypeFromId(getNewEntityId(typeId));
|
||||
wrapper.user().get(EntityTracker.class).addEntity(entityId, entityType);
|
||||
wrapper.write(Type.VAR_INT, entityType.getId());
|
||||
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
wrapper.passthrough(Type.SHORT);
|
||||
wrapper.passthrough(Type.SHORT);
|
||||
wrapper.passthrough(Type.SHORT);
|
||||
wrapper.read(Types1_14.METADATA_LIST); // removed - probably sent in an update packet?
|
||||
wrapper.set(Type.VAR_INT, 1, entityType.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -90,23 +91,22 @@ public class EntityPackets {
|
||||
protocol.registerOutgoing(State.PLAY, 0x05, 0x05, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.VAR_INT); // 0 - Entity ID
|
||||
map(Type.UUID); // 1 - Player UUID
|
||||
map(Type.DOUBLE); // 2 - X
|
||||
map(Type.DOUBLE); // 3 - Y
|
||||
map(Type.DOUBLE); // 4 - Z
|
||||
map(Type.BYTE); // 5 - Yaw
|
||||
map(Type.BYTE); // 6 - Pitch
|
||||
map(Types1_14.METADATA_LIST, Type.NOTHING); // removed - probably sent in an update packet?
|
||||
|
||||
handler(new PacketHandler() {
|
||||
@Override
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
int entityId = wrapper.passthrough(Type.VAR_INT);
|
||||
wrapper.passthrough(Type.UUID);
|
||||
int entityId = wrapper.get(Type.VAR_INT, 0);
|
||||
|
||||
int typeId = wrapper.read(Type.VAR_INT);
|
||||
Entity1_15Types.EntityType entityType = Entity1_15Types.getTypeFromId(getNewEntityId(typeId));
|
||||
Entity1_15Types.EntityType entityType = Entity1_15Types.EntityType.PLAYER;
|
||||
wrapper.user().get(EntityTracker.class).addEntity(entityId, entityType);
|
||||
wrapper.write(Type.VAR_INT, entityType.getId());
|
||||
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.DOUBLE);
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
wrapper.read(Types1_14.METADATA); // removed - probably sent in an update packet?
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren