3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-07-05 23:28:03 +02:00

Fix proxy server switches to equal world names and same the dimension

Dieser Commit ist enthalten in:
KennyTV 2021-03-26 14:47:20 +01:00
Ursprung 9dcd95b2c3
Commit 6403c6480d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -21,6 +21,7 @@ import nl.matsv.viabackwards.api.rewriters.EntityRewriter;
import nl.matsv.viabackwards.protocol.protocol1_15_2to1_16.Protocol1_15_2To1_16;
import nl.matsv.viabackwards.protocol.protocol1_15_2to1_16.data.WorldNameTracker;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.entities.Entity1_15Types;
import us.myles.ViaVersion.api.entities.Entity1_16Types;
import us.myles.ViaVersion.api.entities.EntityType;
@ -112,7 +113,8 @@ public class EntityPackets1_16 extends EntityRewriter<Protocol1_15_2To1_16> {
int dimension = wrapper.get(Type.INT, 0);
// 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().getId() && !nextWorldName.equals(worldNameTracker.getWorldName())) {
if (clientWorld.getEnvironment() != null && dimension == clientWorld.getEnvironment().getId()
&& (Via.getPlatform().isProxy() || !nextWorldName.equals(worldNameTracker.getWorldName()))) {
PacketWrapper packet = wrapper.create(ClientboundPackets1_15.RESPAWN);
packet.write(Type.INT, dimension == 0 ? -1 : 0);
packet.write(Type.LONG, 0L);