3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-10-03 00:50:05 +02:00
Dieser Commit ist enthalten in:
Nassim Jahnke 2022-05-23 18:17:17 +02:00
Ursprung 125fa885f6
Commit 08a583526e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 20 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.3.0-1.19-pre1-SNAPSHOT"
version = "4.3.0-1.19-pre2-SNAPSHOT"
description = "Allow older clients to join newer server versions."
}

Datei anzeigen

@ -71,9 +71,15 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
final byte headYaw = wrapper.read(Type.BYTE);
int data = wrapper.read(Type.VAR_INT);
final EntityType entityType = setOldEntityId(wrapper);
// Hope this is right
if (entityType.isOrHasParent(Entity1_19Types.LIVINGENTITY)) {
wrapper.write(Type.BYTE, headYaw);
// Switch pitch and yaw position
final byte pitch = wrapper.get(Type.BYTE, 0);
final byte yaw = wrapper.get(Type.BYTE, 1);
wrapper.set(Type.BYTE, 0, yaw);
wrapper.set(Type.BYTE, 1, pitch);
wrapper.setPacketType(ClientboundPackets1_18.SPAWN_MOB);
return;
} else if (entityType == Entity1_19Types.PAINTING) {
@ -147,7 +153,11 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
map(Type.LONG); // Seed
map(Type.VAR_INT); // Max players
map(Type.VAR_INT); // Chunk radius
map(Type.VAR_INT); // Read simulation distance
map(Type.VAR_INT); // Simulation distance
map(Type.BOOLEAN); // Reduced debug info
map(Type.BOOLEAN); // Show death screen
map(Type.BOOLEAN); // Flat
read(Type.OPTIONAL_GLOBAL_POSITION); // Read last death location
handler(worldDataTrackerHandler(1));
handler(playerTrackerHandler());
handler(wrapper -> {
@ -180,6 +190,13 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
wrapper.write(Type.NBT, dimension);
});
map(Type.STRING); // World
map(Type.LONG); // Seed
map(Type.UNSIGNED_BYTE); // Gamemode
map(Type.BYTE); // Previous gamemode
map(Type.BOOLEAN); // Debug
map(Type.BOOLEAN); // Flat
map(Type.BOOLEAN); // Keep player data
read(Type.OPTIONAL_GLOBAL_POSITION); // Read last death location
handler(worldDataTrackerHandler(0));
}
});
@ -294,7 +311,6 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
}
});
filter().type(Entity1_19Types.PLAYER).removeIndex(19); // Last death location;
filter().type(Entity1_19Types.CAT).index(19).handler((event, meta) -> meta.setMetaType(Types1_18.META_TYPES.varIntType));
filter().type(Entity1_19Types.FROG).cancel(16); // Age