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

Fix 1.15->1.14 immediate respawn flag in join game

Dieser Commit ist enthalten in:
KennyTV 2021-07-03 10:00:09 +02:00
Ursprung 80360bf27c
Commit 59df758ceb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -29,6 +29,7 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_14;
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ServerboundPackets1_14;
import com.viaversion.viaversion.protocols.protocol1_15to1_14_4.ClientboundPackets1_15;
import java.util.ArrayList;
@ -50,7 +51,7 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
if (!wrapper.user().get(ImmediateRespawn.class).isImmediateRespawn()) return;
// Instantly request respawn when 1.15 gamerule is set
PacketWrapper statusPacket = wrapper.create(0x04);
PacketWrapper statusPacket = wrapper.create(ServerboundPackets1_14.CLIENT_STATUS);
statusPacket.write(Type.VAR_INT, 0);
statusPacket.sendToServer(Protocol1_14_4To1_15.class);
});
@ -122,7 +123,10 @@ public class EntityPackets1_15 extends EntityRewriter<Protocol1_14_4To1_15> {
handler(getTrackerHandler(Entity1_15Types.PLAYER, Type.INT));
handler(wrapper -> wrapper.user().get(ImmediateRespawn.class).setImmediateRespawn(wrapper.read(Type.BOOLEAN)));
handler(wrapper -> {
boolean immediateRespawn = !wrapper.read(Type.BOOLEAN); // Inverted
wrapper.user().get(ImmediateRespawn.class).setImmediateRespawn(immediateRespawn);
});
}
});