Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Small changes
Dieser Commit ist enthalten in:
Ursprung
6635241526
Commit
c4658ecdae
@ -27,6 +27,7 @@ package org.geysermc.connector.network.translators.bedrock;
|
||||
|
||||
import com.github.steveice10.mc.protocol.data.game.ClientRequest;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.client.ClientRequestPacket;
|
||||
import com.nukkitx.math.vector.Vector3f;
|
||||
import com.nukkitx.protocol.bedrock.packet.RespawnPacket;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.network.translators.PacketTranslator;
|
||||
@ -36,6 +37,12 @@ public class BedrockRespawnTranslator extends PacketTranslator<RespawnPacket> {
|
||||
@Override
|
||||
public void translate(RespawnPacket packet, GeyserSession session) {
|
||||
if (packet.getSpawnState() == RespawnPacket.State.CLIENT_READY) {
|
||||
RespawnPacket respawnPacket = new RespawnPacket();
|
||||
respawnPacket.setRuntimeEntityId(0);
|
||||
respawnPacket.setPosition(Vector3f.ZERO);
|
||||
respawnPacket.setSpawnState(RespawnPacket.State.SERVER_SEARCHING);
|
||||
session.getUpstream().sendPacket(respawnPacket);
|
||||
|
||||
ClientRequestPacket javaRespawnPacket = new ClientRequestPacket(ClientRequest.RESPAWN);
|
||||
session.getDownstream().getSession().send(javaRespawnPacket);
|
||||
}
|
||||
|
@ -52,12 +52,6 @@ public class JavaPlayerPositionRotationTranslator extends PacketTranslator<Serve
|
||||
|
||||
RespawnPacket respawnPacket = new RespawnPacket();
|
||||
respawnPacket.setRuntimeEntityId(0);
|
||||
respawnPacket.setPosition(Vector3f.ZERO);
|
||||
respawnPacket.setSpawnState(RespawnPacket.State.SERVER_SEARCHING);
|
||||
session.getUpstream().sendPacket(respawnPacket);
|
||||
|
||||
respawnPacket = new RespawnPacket();
|
||||
respawnPacket.setRuntimeEntityId(0);
|
||||
respawnPacket.setPosition(pos);
|
||||
respawnPacket.setSpawnState(RespawnPacket.State.SERVER_READY);
|
||||
session.getUpstream().sendPacket(respawnPacket);
|
||||
|
@ -28,12 +28,6 @@ public class DimensionUtils {
|
||||
stopSoundPacket.setSoundName("");
|
||||
session.getUpstream().sendPacket(stopSoundPacket);
|
||||
|
||||
EntityEventPacket eventPacket = new EntityEventPacket();
|
||||
eventPacket.setRuntimeEntityId(player.getGeyserId());
|
||||
eventPacket.setEvent(EntityEventPacket.Event.RESPAWN);
|
||||
eventPacket.setData(0);
|
||||
session.getUpstream().sendPacket(eventPacket);
|
||||
|
||||
session.setSpawned(false);
|
||||
session.setSwitchingDimension(true);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren