gamemode2 is previousGamemode

This commit is contained in:
RednedEpic 2020-06-21 15:22:25 -05:00
parent ec957221a9
commit f040b4ee71
2 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ public class ServerJoinGamePacket implements Packet {
private int entityId; private int entityId;
private boolean hardcore; private boolean hardcore;
private @NonNull GameMode gameMode; private @NonNull GameMode gameMode;
private @NonNull GameMode gameMode2; private @NonNull GameMode previousGamemode;
private int worldCount; private int worldCount;
private String[] worldNames; private String[] worldNames;
private @NonNull CompoundTag dimensionCodec; private @NonNull CompoundTag dimensionCodec;
@ -48,7 +48,7 @@ public class ServerJoinGamePacket implements Packet {
int gameMode = in.readUnsignedByte(); int gameMode = in.readUnsignedByte();
this.hardcore = (gameMode & GAMEMODE_FLAG_HARDCORE) != 0; this.hardcore = (gameMode & GAMEMODE_FLAG_HARDCORE) != 0;
this.gameMode = MagicValues.key(GameMode.class, gameMode & GAMEMODE_MASK); this.gameMode = MagicValues.key(GameMode.class, gameMode & GAMEMODE_MASK);
this.gameMode2 = MagicValues.key(GameMode.class, in.readUnsignedByte()); this.previousGamemode = MagicValues.key(GameMode.class, in.readUnsignedByte());
this.worldCount = in.readVarInt(); this.worldCount = in.readVarInt();
this.worldNames = new String[this.worldCount]; this.worldNames = new String[this.worldCount];
for (int i = 0; i < this.worldCount; i++) { for (int i = 0; i < this.worldCount; i++) {
@ -76,7 +76,7 @@ public class ServerJoinGamePacket implements Packet {
} }
out.writeByte(gameMode); out.writeByte(gameMode);
out.writeByte(MagicValues.value(Integer.class, this.gameMode2)); out.writeByte(MagicValues.value(Integer.class, this.previousGamemode));
out.writeVarInt(this.worldCount); out.writeVarInt(this.worldCount);
for (String worldName : this.worldNames) { for (String worldName : this.worldNames) {
out.writeString(worldName); out.writeString(worldName);

View file

@ -23,7 +23,7 @@ public class ServerRespawnPacket implements Packet {
private String worldName; private String worldName;
private long hashedSeed; private long hashedSeed;
private @NonNull GameMode gamemode; private @NonNull GameMode gamemode;
private @NonNull GameMode gamemode2; private @NonNull GameMode previousGamemode;
private boolean debug; private boolean debug;
private boolean flat; private boolean flat;
private boolean copyMetadata; private boolean copyMetadata;
@ -34,7 +34,7 @@ public class ServerRespawnPacket implements Packet {
this.worldName = in.readString(); this.worldName = in.readString();
this.hashedSeed = in.readLong(); this.hashedSeed = in.readLong();
this.gamemode = MagicValues.key(GameMode.class, in.readUnsignedByte()); this.gamemode = MagicValues.key(GameMode.class, in.readUnsignedByte());
this.gamemode2 = MagicValues.key(GameMode.class, in.readUnsignedByte()); this.previousGamemode = MagicValues.key(GameMode.class, in.readUnsignedByte());
this.debug = in.readBoolean(); this.debug = in.readBoolean();
this.flat = in.readBoolean(); this.flat = in.readBoolean();
this.copyMetadata = in.readBoolean(); this.copyMetadata = in.readBoolean();
@ -46,7 +46,7 @@ public class ServerRespawnPacket implements Packet {
out.writeString(this.worldName); out.writeString(this.worldName);
out.writeLong(this.hashedSeed); out.writeLong(this.hashedSeed);
out.writeByte(MagicValues.value(Integer.class, this.gamemode)); out.writeByte(MagicValues.value(Integer.class, this.gamemode));
out.writeByte(MagicValues.value(Integer.class, this.gamemode2)); out.writeByte(MagicValues.value(Integer.class, this.previousGamemode));
out.writeBoolean(this.debug); out.writeBoolean(this.debug);
out.writeBoolean(this.flat); out.writeBoolean(this.flat);
out.writeBoolean(this.copyMetadata); out.writeBoolean(this.copyMetadata);