more packets (1.9)

This commit is contained in:
Bixilon 2020-06-30 16:33:52 +02:00
parent ada7f23ae5
commit bb19b3a683
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 10 additions and 3 deletions

View File

@ -16,7 +16,7 @@ package de.bixilon.minosoft.game.datatypes.blocks;
import de.bixilon.minosoft.game.datatypes.Color;
public enum Blocks {
UNKNOWN(-1), // the buggy pink black block
UNKNOWN(-1), // the buggy pink black block (any other block)
AIR(0),
STONE(1),
GRASS(2),

View File

@ -38,7 +38,7 @@ public class Connection {
final ArrayList<ClientboundPacket> handlingQueue;
PluginChannelHandler pluginChannelHandler;
Thread handleThread;
ProtocolVersion version = ProtocolVersion.VERSION_1_7_10; // default
ProtocolVersion version = Protocol.getLowestVersionSupported(); // default
Player player;
ConnectionState state = ConnectionState.DISCONNECTED;
ConnectionReason reason;
@ -114,7 +114,7 @@ public class Connection {
case DISCONNECTED:
if (reason == ConnectionReason.GET_VERSION) {
//ToDo: only for development, remove later
//setVersion(ProtocolVersion.VERSION_1_9_4);
setVersion(ProtocolVersion.VERSION_1_9_4);
setReason(ConnectionReason.CONNECT);
connect();
}

View File

@ -17,6 +17,7 @@ import de.bixilon.minosoft.logging.Log;
import de.bixilon.minosoft.protocol.packets.ClientboundPacket;
import de.bixilon.minosoft.protocol.protocol.InPacketBuffer;
import de.bixilon.minosoft.protocol.protocol.PacketHandler;
import de.bixilon.minosoft.protocol.protocol.ProtocolVersion;
import de.bixilon.minosoft.util.BitByte;
import java.util.ArrayList;
@ -72,8 +73,12 @@ public class PacketMapData implements ClientboundPacket {
}
return true;
case VERSION_1_8:
case VERSION_1_9_4: {
mapId = buffer.readVarInt();
scale = buffer.readByte();
if (buffer.getVersion().getVersion() >= ProtocolVersion.VERSION_1_9_4.getVersion()) {
boolean trackPosition = buffer.readBoolean();
}
int pinCount = buffer.readVarInt();
pins = new ArrayList<>();
for (int i = 0; i < pinCount; i++) {
@ -93,6 +98,7 @@ public class PacketMapData implements ClientboundPacket {
}
return true;
}
}
return false;
}

View File

@ -51,6 +51,7 @@ public class PacketParticle implements ClientboundPacket {
count = buffer.readInteger();
return true;
case VERSION_1_8:
case VERSION_1_9_4:
particle = Particles.byType(buffer.readInteger());
longDistance = buffer.readBoolean();
x = buffer.readFloat();