From 20f73c5e1e76fbfd33f29ebbe2aee14889bfea89 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 13 May 2020 16:06:26 -0500 Subject: [PATCH] Update to 20w20a --- .../mc/protocol/test/MinecraftProtocolTest.java | 1 - pom.xml | 2 +- .../steveice10/mc/protocol/MinecraftConstants.java | 4 ++-- .../steveice10/mc/protocol/data/MagicValues.java | 10 ---------- .../mc/protocol/data/game/world/WorldType.java | 12 ------------ .../packet/ingame/server/ServerJoinGamePacket.java | 10 ++++++---- .../packet/ingame/server/ServerRespawnPacket.java | 10 ++++++---- .../mc/protocol/MinecraftProtocolTest.java | 3 +-- .../steveice10/mc/protocol/data/MagicValuesTest.java | 2 -- 9 files changed, 16 insertions(+), 38 deletions(-) delete mode 100644 src/main/java/com/github/steveice10/mc/protocol/data/game/world/WorldType.java diff --git a/example/com/github/steveice10/mc/protocol/test/MinecraftProtocolTest.java b/example/com/github/steveice10/mc/protocol/test/MinecraftProtocolTest.java index 7bf32867..b9fc67f3 100644 --- a/example/com/github/steveice10/mc/protocol/test/MinecraftProtocolTest.java +++ b/example/com/github/steveice10/mc/protocol/test/MinecraftProtocolTest.java @@ -7,7 +7,6 @@ import com.github.steveice10.mc.protocol.MinecraftProtocol; import com.github.steveice10.mc.protocol.ServerLoginHandler; import com.github.steveice10.mc.protocol.data.SubProtocol; import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; -import com.github.steveice10.mc.protocol.data.game.world.WorldType; import com.github.steveice10.mc.protocol.data.message.ChatColor; import com.github.steveice10.mc.protocol.data.message.ChatFormat; import com.github.steveice10.mc.protocol.data.message.Message; diff --git a/pom.xml b/pom.xml index bdeab425..769b0f1d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.steveice10 mcprotocollib - 20w19a-SNAPSHOT + 20w20a-SNAPSHOT jar MCProtocolLib diff --git a/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java b/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java index b6bb904e..c4bd7528 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java +++ b/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java @@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol; public class MinecraftConstants { // General Constants - public static final String GAME_VERSION = "20w19a"; - public static final int PROTOCOL_VERSION = 715; + public static final String GAME_VERSION = "20w120a"; + public static final int PROTOCOL_VERSION = 716; // General Key Constants public static final String PROFILE_KEY = "profile"; diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java index 9ba5005c..c28f36f7 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/MagicValues.java @@ -69,7 +69,6 @@ import com.github.steveice10.mc.protocol.data.game.window.property.BrewingStandP import com.github.steveice10.mc.protocol.data.game.window.property.EnchantmentTableProperty; import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty; import com.github.steveice10.mc.protocol.data.game.world.WorldBorderAction; -import com.github.steveice10.mc.protocol.data.game.world.WorldType; import com.github.steveice10.mc.protocol.data.game.world.block.BlockFace; import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode; import com.github.steveice10.mc.protocol.data.game.world.block.StructureMirror; @@ -271,15 +270,6 @@ public class MagicValues { register(Difficulty.NORMAL, 2); register(Difficulty.HARD, 3); - register(WorldType.DEFAULT, "default"); - register(WorldType.FLAT, "flat"); - register(WorldType.LARGE_BIOMES, "largebiomes"); - register(WorldType.AMPLIFIED, "amplified"); - register(WorldType.CUSTOMIZED, "customized"); - register(WorldType.BUFFET, "buffet"); - register(WorldType.DEBUG, "debug_all_block_states"); - register(WorldType.DEFAULT_1_1, "default_1_1"); - register(Animation.SWING_ARM, 0); register(Animation.DAMAGE, 1); register(Animation.LEAVE_BED, 2); diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/game/world/WorldType.java b/src/main/java/com/github/steveice10/mc/protocol/data/game/world/WorldType.java deleted file mode 100644 index b5d5b044..00000000 --- a/src/main/java/com/github/steveice10/mc/protocol/data/game/world/WorldType.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.steveice10.mc.protocol.data.game.world; - -public enum WorldType { - DEFAULT, - FLAT, - LARGE_BIOMES, - AMPLIFIED, - CUSTOMIZED, - BUFFET, - DEBUG, - DEFAULT_1_1; -} diff --git a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java index 76fa0181..e251b12c 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java +++ b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java @@ -2,7 +2,6 @@ package com.github.steveice10.mc.protocol.packet.ingame.server; import com.github.steveice10.mc.protocol.data.MagicValues; import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; -import com.github.steveice10.mc.protocol.data.game.world.WorldType; import com.github.steveice10.packetlib.io.NetInput; import com.github.steveice10.packetlib.io.NetOutput; import com.github.steveice10.packetlib.packet.Packet; @@ -29,10 +28,11 @@ public class ServerJoinGamePacket implements Packet { private int dimension; private long hashedSeed; private int maxPlayers; - private @NonNull WorldType worldType; private int viewDistance; private boolean reducedDebugInfo; private boolean enableRespawnScreen; + private boolean debug; + private boolean flat; @Override public void read(NetInput in) throws IOException { @@ -45,10 +45,11 @@ public class ServerJoinGamePacket implements Packet { this.dimension = in.readInt(); this.hashedSeed = in.readLong(); this.maxPlayers = in.readUnsignedByte(); - this.worldType = MagicValues.key(WorldType.class, in.readString().toLowerCase()); this.viewDistance = in.readVarInt(); this.reducedDebugInfo = in.readBoolean(); this.enableRespawnScreen = in.readBoolean(); + this.debug = in.readBoolean(); + this.flat = in.readBoolean(); } @Override @@ -65,10 +66,11 @@ public class ServerJoinGamePacket implements Packet { out.writeInt(this.dimension); out.writeLong(this.hashedSeed); out.writeByte(this.maxPlayers); - out.writeString(MagicValues.value(String.class, this.worldType)); out.writeVarInt(this.viewDistance); out.writeBoolean(this.reducedDebugInfo); out.writeBoolean(this.enableRespawnScreen); + out.writeBoolean(this.debug); + out.writeBoolean(this.flat); } @Override diff --git a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerRespawnPacket.java b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerRespawnPacket.java index 8becfc77..4b15ab07 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerRespawnPacket.java +++ b/src/main/java/com/github/steveice10/mc/protocol/packet/ingame/server/ServerRespawnPacket.java @@ -2,7 +2,6 @@ package com.github.steveice10.mc.protocol.packet.ingame.server; import com.github.steveice10.mc.protocol.data.MagicValues; import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; -import com.github.steveice10.mc.protocol.data.game.world.WorldType; import com.github.steveice10.packetlib.io.NetInput; import com.github.steveice10.packetlib.io.NetOutput; import com.github.steveice10.packetlib.packet.Packet; @@ -23,7 +22,8 @@ public class ServerRespawnPacket implements Packet { private int dimension; private long hashedSeed; private @NonNull GameMode gamemode; - private @NonNull WorldType worldType; + private boolean debug; + private boolean flat; private boolean copyMetadata; @Override @@ -31,7 +31,8 @@ public class ServerRespawnPacket implements Packet { this.dimension = in.readInt(); this.hashedSeed = in.readLong(); this.gamemode = MagicValues.key(GameMode.class, in.readUnsignedByte()); - this.worldType = MagicValues.key(WorldType.class, in.readString().toLowerCase()); + this.debug = in.readBoolean(); + this.flat = in.readBoolean(); this.copyMetadata = in.readBoolean(); } @@ -40,7 +41,8 @@ public class ServerRespawnPacket implements Packet { out.writeInt(this.dimension); out.writeLong(this.hashedSeed); out.writeByte(MagicValues.value(Integer.class, this.gamemode)); - out.writeString(MagicValues.value(String.class, this.worldType)); + out.writeBoolean(this.debug); + out.writeBoolean(this.flat); out.writeBoolean(this.copyMetadata); } diff --git a/src/test/java/com/github/steveice10/mc/protocol/MinecraftProtocolTest.java b/src/test/java/com/github/steveice10/mc/protocol/MinecraftProtocolTest.java index 008435e1..8e0f298f 100644 --- a/src/test/java/com/github/steveice10/mc/protocol/MinecraftProtocolTest.java +++ b/src/test/java/com/github/steveice10/mc/protocol/MinecraftProtocolTest.java @@ -29,7 +29,6 @@ import static com.github.steveice10.mc.protocol.MinecraftConstants.SERVER_INFO_H import static com.github.steveice10.mc.protocol.MinecraftConstants.SERVER_LOGIN_HANDLER_KEY; import static com.github.steveice10.mc.protocol.MinecraftConstants.VERIFY_USERS_KEY; import static com.github.steveice10.mc.protocol.data.SubProtocol.STATUS; -import static com.github.steveice10.mc.protocol.data.game.world.WorldType.DEFAULT; import static java.util.concurrent.TimeUnit.SECONDS; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -45,7 +44,7 @@ public class MinecraftProtocolTest { new TextMessage("Hello world!"), null ); - private static final ServerJoinGamePacket JOIN_GAME_PACKET = new ServerJoinGamePacket(0, false, GameMode.SURVIVAL, 0, 100, 0, DEFAULT, 16, false, false); + private static final ServerJoinGamePacket JOIN_GAME_PACKET = new ServerJoinGamePacket(0, false, GameMode.SURVIVAL, 0, 100, 0, 16, false, false, false, false); private static Server server; diff --git a/src/test/java/com/github/steveice10/mc/protocol/data/MagicValuesTest.java b/src/test/java/com/github/steveice10/mc/protocol/data/MagicValuesTest.java index 5834186f..ce34ef64 100644 --- a/src/test/java/com/github/steveice10/mc/protocol/data/MagicValuesTest.java +++ b/src/test/java/com/github/steveice10/mc/protocol/data/MagicValuesTest.java @@ -69,7 +69,6 @@ import com.github.steveice10.mc.protocol.data.game.window.property.BrewingStandP import com.github.steveice10.mc.protocol.data.game.window.property.EnchantmentTableProperty; import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty; import com.github.steveice10.mc.protocol.data.game.world.WorldBorderAction; -import com.github.steveice10.mc.protocol.data.game.world.WorldType; import com.github.steveice10.mc.protocol.data.game.world.block.BlockFace; import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode; import com.github.steveice10.mc.protocol.data.game.world.block.StructureMirror; @@ -140,7 +139,6 @@ public class MagicValuesTest { this.register(CombatState.class, Integer.class); this.register(GameMode.class, Integer.class); this.register(Difficulty.class, Integer.class); - this.register(WorldType.class, String.class); this.register(Animation.class, Integer.class); this.register(Effect.class, Integer.class); this.register(EntityStatus.class, Integer.class);