Update to 20w20a

This commit is contained in:
RednedEpic 2020-05-13 16:06:26 -05:00
parent b0b383a53d
commit 20f73c5e1e
9 changed files with 16 additions and 38 deletions

View file

@ -7,7 +7,6 @@ import com.github.steveice10.mc.protocol.MinecraftProtocol;
import com.github.steveice10.mc.protocol.ServerLoginHandler; import com.github.steveice10.mc.protocol.ServerLoginHandler;
import com.github.steveice10.mc.protocol.data.SubProtocol; 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.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.ChatColor;
import com.github.steveice10.mc.protocol.data.message.ChatFormat; import com.github.steveice10.mc.protocol.data.message.ChatFormat;
import com.github.steveice10.mc.protocol.data.message.Message; import com.github.steveice10.mc.protocol.data.message.Message;

View file

@ -5,7 +5,7 @@
<groupId>com.github.steveice10</groupId> <groupId>com.github.steveice10</groupId>
<artifactId>mcprotocollib</artifactId> <artifactId>mcprotocollib</artifactId>
<version>20w19a-SNAPSHOT</version> <version>20w20a-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>MCProtocolLib</name> <name>MCProtocolLib</name>

View file

@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol;
public class MinecraftConstants { public class MinecraftConstants {
// General Constants // General Constants
public static final String GAME_VERSION = "20w19a"; public static final String GAME_VERSION = "20w120a";
public static final int PROTOCOL_VERSION = 715; public static final int PROTOCOL_VERSION = 716;
// General Key Constants // General Key Constants
public static final String PROFILE_KEY = "profile"; public static final String PROFILE_KEY = "profile";

View file

@ -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.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty; 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.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.BlockFace;
import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode; import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode;
import com.github.steveice10.mc.protocol.data.game.world.block.StructureMirror; import com.github.steveice10.mc.protocol.data.game.world.block.StructureMirror;
@ -271,15 +270,6 @@ public class MagicValues {
register(Difficulty.NORMAL, 2); register(Difficulty.NORMAL, 2);
register(Difficulty.HARD, 3); 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.SWING_ARM, 0);
register(Animation.DAMAGE, 1); register(Animation.DAMAGE, 1);
register(Animation.LEAVE_BED, 2); register(Animation.LEAVE_BED, 2);

View file

@ -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;
}

View file

@ -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.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; 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.NetInput;
import com.github.steveice10.packetlib.io.NetOutput; import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet; import com.github.steveice10.packetlib.packet.Packet;
@ -29,10 +28,11 @@ public class ServerJoinGamePacket implements Packet {
private int dimension; private int dimension;
private long hashedSeed; private long hashedSeed;
private int maxPlayers; private int maxPlayers;
private @NonNull WorldType worldType;
private int viewDistance; private int viewDistance;
private boolean reducedDebugInfo; private boolean reducedDebugInfo;
private boolean enableRespawnScreen; private boolean enableRespawnScreen;
private boolean debug;
private boolean flat;
@Override @Override
public void read(NetInput in) throws IOException { public void read(NetInput in) throws IOException {
@ -45,10 +45,11 @@ public class ServerJoinGamePacket implements Packet {
this.dimension = in.readInt(); this.dimension = in.readInt();
this.hashedSeed = in.readLong(); this.hashedSeed = in.readLong();
this.maxPlayers = in.readUnsignedByte(); this.maxPlayers = in.readUnsignedByte();
this.worldType = MagicValues.key(WorldType.class, in.readString().toLowerCase());
this.viewDistance = in.readVarInt(); this.viewDistance = in.readVarInt();
this.reducedDebugInfo = in.readBoolean(); this.reducedDebugInfo = in.readBoolean();
this.enableRespawnScreen = in.readBoolean(); this.enableRespawnScreen = in.readBoolean();
this.debug = in.readBoolean();
this.flat = in.readBoolean();
} }
@Override @Override
@ -65,10 +66,11 @@ public class ServerJoinGamePacket implements Packet {
out.writeInt(this.dimension); out.writeInt(this.dimension);
out.writeLong(this.hashedSeed); out.writeLong(this.hashedSeed);
out.writeByte(this.maxPlayers); out.writeByte(this.maxPlayers);
out.writeString(MagicValues.value(String.class, this.worldType));
out.writeVarInt(this.viewDistance); out.writeVarInt(this.viewDistance);
out.writeBoolean(this.reducedDebugInfo); out.writeBoolean(this.reducedDebugInfo);
out.writeBoolean(this.enableRespawnScreen); out.writeBoolean(this.enableRespawnScreen);
out.writeBoolean(this.debug);
out.writeBoolean(this.flat);
} }
@Override @Override

View file

@ -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.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode; 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.NetInput;
import com.github.steveice10.packetlib.io.NetOutput; import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet; import com.github.steveice10.packetlib.packet.Packet;
@ -23,7 +22,8 @@ public class ServerRespawnPacket implements Packet {
private int dimension; private int dimension;
private long hashedSeed; private long hashedSeed;
private @NonNull GameMode gamemode; private @NonNull GameMode gamemode;
private @NonNull WorldType worldType; private boolean debug;
private boolean flat;
private boolean copyMetadata; private boolean copyMetadata;
@Override @Override
@ -31,7 +31,8 @@ public class ServerRespawnPacket implements Packet {
this.dimension = in.readInt(); this.dimension = in.readInt();
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.worldType = MagicValues.key(WorldType.class, in.readString().toLowerCase()); this.debug = in.readBoolean();
this.flat = in.readBoolean();
this.copyMetadata = in.readBoolean(); this.copyMetadata = in.readBoolean();
} }
@ -40,7 +41,8 @@ public class ServerRespawnPacket implements Packet {
out.writeInt(this.dimension); out.writeInt(this.dimension);
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.writeString(MagicValues.value(String.class, this.worldType)); out.writeBoolean(this.debug);
out.writeBoolean(this.flat);
out.writeBoolean(this.copyMetadata); out.writeBoolean(this.copyMetadata);
} }

View file

@ -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.SERVER_LOGIN_HANDLER_KEY;
import static com.github.steveice10.mc.protocol.MinecraftConstants.VERIFY_USERS_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.SubProtocol.STATUS;
import static com.github.steveice10.mc.protocol.data.game.world.WorldType.DEFAULT;
import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -45,7 +44,7 @@ public class MinecraftProtocolTest {
new TextMessage("Hello world!"), new TextMessage("Hello world!"),
null 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; private static Server server;

View file

@ -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.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty; 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.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.BlockFace;
import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode; import com.github.steveice10.mc.protocol.data.game.world.block.CommandBlockMode;
import com.github.steveice10.mc.protocol.data.game.world.block.StructureMirror; 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(CombatState.class, Integer.class);
this.register(GameMode.class, Integer.class); this.register(GameMode.class, Integer.class);
this.register(Difficulty.class, Integer.class); this.register(Difficulty.class, Integer.class);
this.register(WorldType.class, String.class);
this.register(Animation.class, Integer.class); this.register(Animation.class, Integer.class);
this.register(Effect.class, Integer.class); this.register(Effect.class, Integer.class);
this.register(EntityStatus.class, Integer.class); this.register(EntityStatus.class, Integer.class);