mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
more packets (1.9)
This commit is contained in:
parent
ada7f23ae5
commit
bb19b3a683
@ -16,7 +16,7 @@ package de.bixilon.minosoft.game.datatypes.blocks;
|
|||||||
import de.bixilon.minosoft.game.datatypes.Color;
|
import de.bixilon.minosoft.game.datatypes.Color;
|
||||||
|
|
||||||
public enum Blocks {
|
public enum Blocks {
|
||||||
UNKNOWN(-1), // the buggy pink black block
|
UNKNOWN(-1), // the buggy pink black block (any other block)
|
||||||
AIR(0),
|
AIR(0),
|
||||||
STONE(1),
|
STONE(1),
|
||||||
GRASS(2),
|
GRASS(2),
|
||||||
|
@ -38,7 +38,7 @@ public class Connection {
|
|||||||
final ArrayList<ClientboundPacket> handlingQueue;
|
final ArrayList<ClientboundPacket> handlingQueue;
|
||||||
PluginChannelHandler pluginChannelHandler;
|
PluginChannelHandler pluginChannelHandler;
|
||||||
Thread handleThread;
|
Thread handleThread;
|
||||||
ProtocolVersion version = ProtocolVersion.VERSION_1_7_10; // default
|
ProtocolVersion version = Protocol.getLowestVersionSupported(); // default
|
||||||
Player player;
|
Player player;
|
||||||
ConnectionState state = ConnectionState.DISCONNECTED;
|
ConnectionState state = ConnectionState.DISCONNECTED;
|
||||||
ConnectionReason reason;
|
ConnectionReason reason;
|
||||||
@ -114,7 +114,7 @@ public class Connection {
|
|||||||
case DISCONNECTED:
|
case DISCONNECTED:
|
||||||
if (reason == ConnectionReason.GET_VERSION) {
|
if (reason == ConnectionReason.GET_VERSION) {
|
||||||
//ToDo: only for development, remove later
|
//ToDo: only for development, remove later
|
||||||
//setVersion(ProtocolVersion.VERSION_1_9_4);
|
setVersion(ProtocolVersion.VERSION_1_9_4);
|
||||||
setReason(ConnectionReason.CONNECT);
|
setReason(ConnectionReason.CONNECT);
|
||||||
connect();
|
connect();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ import de.bixilon.minosoft.logging.Log;
|
|||||||
import de.bixilon.minosoft.protocol.packets.ClientboundPacket;
|
import de.bixilon.minosoft.protocol.packets.ClientboundPacket;
|
||||||
import de.bixilon.minosoft.protocol.protocol.InPacketBuffer;
|
import de.bixilon.minosoft.protocol.protocol.InPacketBuffer;
|
||||||
import de.bixilon.minosoft.protocol.protocol.PacketHandler;
|
import de.bixilon.minosoft.protocol.protocol.PacketHandler;
|
||||||
|
import de.bixilon.minosoft.protocol.protocol.ProtocolVersion;
|
||||||
import de.bixilon.minosoft.util.BitByte;
|
import de.bixilon.minosoft.util.BitByte;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -72,8 +73,12 @@ public class PacketMapData implements ClientboundPacket {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case VERSION_1_8:
|
case VERSION_1_8:
|
||||||
|
case VERSION_1_9_4: {
|
||||||
mapId = buffer.readVarInt();
|
mapId = buffer.readVarInt();
|
||||||
scale = buffer.readByte();
|
scale = buffer.readByte();
|
||||||
|
if (buffer.getVersion().getVersion() >= ProtocolVersion.VERSION_1_9_4.getVersion()) {
|
||||||
|
boolean trackPosition = buffer.readBoolean();
|
||||||
|
}
|
||||||
int pinCount = buffer.readVarInt();
|
int pinCount = buffer.readVarInt();
|
||||||
pins = new ArrayList<>();
|
pins = new ArrayList<>();
|
||||||
for (int i = 0; i < pinCount; i++) {
|
for (int i = 0; i < pinCount; i++) {
|
||||||
@ -92,6 +97,7 @@ public class PacketMapData implements ClientboundPacket {
|
|||||||
data = buffer.readBytes(dataLength);
|
data = buffer.readBytes(dataLength);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -51,6 +51,7 @@ public class PacketParticle implements ClientboundPacket {
|
|||||||
count = buffer.readInteger();
|
count = buffer.readInteger();
|
||||||
return true;
|
return true;
|
||||||
case VERSION_1_8:
|
case VERSION_1_8:
|
||||||
|
case VERSION_1_9_4:
|
||||||
particle = Particles.byType(buffer.readInteger());
|
particle = Particles.byType(buffer.readInteger());
|
||||||
longDistance = buffer.readBoolean();
|
longDistance = buffer.readBoolean();
|
||||||
x = buffer.readFloat();
|
x = buffer.readFloat();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user