mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Ensure that the player never dimension switches to the same dimension
Fixes #2342
This commit is contained in:
parent
b757032457
commit
7ae27c79e8
1 changed files with 5 additions and 2 deletions
|
@ -83,8 +83,11 @@ public class JavaRespawnTranslator extends PacketTranslator<ServerRespawnPacket>
|
|||
|
||||
String newDimension = DimensionUtils.getNewDimension(packet.getDimension());
|
||||
if (!session.getDimension().equals(newDimension) || !packet.getWorldName().equals(session.getWorldName())) {
|
||||
if (!packet.getWorldName().equals(session.getWorldName()) && session.getDimension().equals(newDimension)) {
|
||||
// Switching to a new world (based off the world name change); send a fake dimension change
|
||||
if (!packet.getWorldName().equals(session.getWorldName()) && (session.getDimension().equals(newDimension)
|
||||
// Ensure that the player never ever dimension switches to the same dimension - BAD
|
||||
// Can likely be removed if the Above Bedrock Nether Building option can be removed
|
||||
|| DimensionUtils.javaToBedrock(session.getDimension()) == DimensionUtils.javaToBedrock(newDimension))) {
|
||||
String fakeDim = DimensionUtils.getTemporaryDimension(session.getDimension(), newDimension);
|
||||
DimensionUtils.switchDimension(session, fakeDim);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue