3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 16:40:12 +01:00

Update VV usage

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-02-14 11:13:58 +01:00
Ursprung 5a3a82a83d
Commit 45c44c8f7e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
3 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -171,7 +171,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
} }
if (chunk.isBiomeData()) { if (chunk.isBiomeData()) {
if (wrapper.user().getProtocolInfo().getServerProtocolVersion() >= ProtocolVersion.v1_16_2.getVersion()) { if (wrapper.user().getProtocolInfo().serverProtocolVersion().newerThanOrEquals(ProtocolVersion.v1_16_2)) {
BiomeStorage biomeStorage = wrapper.user().get(BiomeStorage.class); BiomeStorage biomeStorage = wrapper.user().get(BiomeStorage.class);
for (int i = 0; i < 1024; i++) { for (int i = 0; i < 1024; i++) {
int biome = chunk.getBiomeData()[i]; int biome = chunk.getBiomeData()[i];

Datei anzeigen

@ -119,7 +119,7 @@ public class EntityPackets1_16 extends EntityRewriter<ClientboundPackets1_16, Pr
// Send a dummy respawn with a different dimension if the world name was different and the same dimension was used // Send a dummy respawn with a different dimension if the world name was different and the same dimension was used
if (clientWorld.getEnvironment() != null && dimension == clientWorld.getEnvironment().id() if (clientWorld.getEnvironment() != null && dimension == clientWorld.getEnvironment().id()
&& (wrapper.user().isClientSide() || Via.getPlatform().isProxy() && (wrapper.user().isClientSide() || Via.getPlatform().isProxy()
|| wrapper.user().getProtocolInfo().protocolVersion().lowerThanOrEquals(ProtocolVersion.v1_12_2) // Hotfix for https://github.com/ViaVersion/ViaBackwards/issues/381 || wrapper.user().getProtocolInfo().protocolVersion().olderThanOrEquals(ProtocolVersion.v1_12_2) // Hotfix for https://github.com/ViaVersion/ViaBackwards/issues/381
|| !nextWorldName.equals(worldNameTracker.getWorldName()))) { || !nextWorldName.equals(worldNameTracker.getWorldName()))) {
PacketWrapper packet = wrapper.create(ClientboundPackets1_15.RESPAWN); PacketWrapper packet = wrapper.create(ClientboundPackets1_15.RESPAWN);
packet.write(Type.INT, dimension == 0 ? -1 : 0); packet.write(Type.INT, dimension == 0 ? -1 : 0);

Datei anzeigen

@ -73,7 +73,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<ClientboundPackets1_16_2
map(Type.STRING_ARRAY); // World List map(Type.STRING_ARRAY); // World List
handler(wrapper -> { handler(wrapper -> {
CompoundTag registry = wrapper.read(Type.NAMED_COMPOUND_TAG); CompoundTag registry = wrapper.read(Type.NAMED_COMPOUND_TAG);
if (wrapper.user().getProtocolInfo().protocolVersion().lowerThanOrEquals(ProtocolVersion.v1_15_2)) { if (wrapper.user().getProtocolInfo().protocolVersion().olderThanOrEquals(ProtocolVersion.v1_15_2)) {
// Store biomes for <1.16 client handling // Store biomes for <1.16 client handling
CompoundTag biomeRegistry = registry.get("minecraft:worldgen/biome"); CompoundTag biomeRegistry = registry.get("minecraft:worldgen/biome");
ListTag biomes = biomeRegistry.get("value"); ListTag biomes = biomeRegistry.get("value");