Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 00:23:03 +01:00
Fix Redudant Gamemode Code
Dieser Commit ist enthalten in:
Ursprung
ebd1e502f2
Commit
fc50242c47
@ -43,14 +43,7 @@ public class JavaJoinGameTranslator extends PacketTranslator<ServerJoinGamePacke
|
|||||||
bedrockPacket.setUniqueEntityId(packet.getEntityId());
|
bedrockPacket.setUniqueEntityId(packet.getEntityId());
|
||||||
session.getUpstream().sendPacketImmediately(bedrockPacket);
|
session.getUpstream().sendPacketImmediately(bedrockPacket);
|
||||||
|
|
||||||
int gamemode = 0;
|
int gamemode = packet.getGameMode().ordinal();
|
||||||
if (packet.getGameMode().equals(GameMode.CREATIVE)) {
|
|
||||||
gamemode = 1;
|
|
||||||
} else if (packet.getGameMode().equals(GameMode.ADVENTURE)) {
|
|
||||||
gamemode = 2;
|
|
||||||
} else if (packet.getGameMode().equals(GameMode.SPECTATOR)) {
|
|
||||||
gamemode = 3;
|
|
||||||
}
|
|
||||||
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
|
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
|
||||||
playerGameTypePacket.setGamemode(gamemode);
|
playerGameTypePacket.setGamemode(gamemode);
|
||||||
|
|
||||||
|
@ -57,14 +57,7 @@ public class JavaNotifyClientTranslator extends PacketTranslator<ServerNotifyCli
|
|||||||
session.getUpstream().sendPacket(stopRainPacket);
|
session.getUpstream().sendPacket(stopRainPacket);
|
||||||
break;
|
break;
|
||||||
case CHANGE_GAMEMODE:
|
case CHANGE_GAMEMODE:
|
||||||
int gamemode = 0;
|
int gamemode = ((GameMode) packet.getValue()).ordinal();
|
||||||
if (packet.getValue().equals(GameMode.CREATIVE)) {
|
|
||||||
gamemode = 1;
|
|
||||||
} else if (packet.getValue().equals(GameMode.ADVENTURE)) {
|
|
||||||
gamemode = 2;
|
|
||||||
} else if (packet.getValue().equals(GameMode.SPECTATOR)) {
|
|
||||||
gamemode = 3;
|
|
||||||
}
|
|
||||||
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
|
SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket();
|
||||||
playerGameTypePacket.setGamemode(gamemode);
|
playerGameTypePacket.setGamemode(gamemode);
|
||||||
break;
|
break;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren