Archived
0

переход на BlockLocationSerializer

This commit is contained in:
2018-09-08 17:05:26 +03:00
parent debb75a080
commit fb6ced9c9b
4 changed files with 4 additions and 35 deletions

View File

@@ -2,6 +2,7 @@ package mc.core.network.proto_1_12_2.packets;
import lombok.Getter;
import lombok.ToString;
import mc.core.network.proto_1_12_2.serializers.BlockLocationSerializer;
import mc.core.world.block.BlockLocation;
import mc.core.network.CSPacket;
import mc.core.network.NetInputStream;
@@ -20,8 +21,7 @@ public class PlayerBlockPlacementPacket implements CSPacket {
@Override
public void readSelf(NetInputStream netStream) {
long compactedCoords = netStream.readLong();
double[] xyz = CompactedCoords.uncompressXYZ(compactedCoords);
location = new BlockLocation((int)xyz[0], (int)xyz[1], (int)xyz[2]); //FIXME
location = BlockLocationSerializer.fromLong(compactedCoords);
face = Direction.getById(netStream.readVarInt());
hand = (netStream.readVarInt() == 1);
cursorX = netStream.readFloat();

View File

@@ -3,6 +3,7 @@ package mc.core.network.proto_1_12_2.packets;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import mc.core.network.proto_1_12_2.serializers.BlockLocationSerializer;
import mc.core.world.block.BlockLocation;
import mc.core.network.CSPacket;
import mc.core.network.NetInputStream;
@@ -49,8 +50,7 @@ public class PlayerDiggingPacket implements CSPacket {
public void readSelf(NetInputStream netStream) {
status = Status.getById(netStream.readVarInt());
long compactCoord = netStream.readLong();
double[] xyz = CompactedCoords.uncompressXYZ(compactCoord);
location = new BlockLocation((int)xyz[0], (int)xyz[1], (int)xyz[2]); //FIXME
location = BlockLocationSerializer.fromLong(compactCoord);
face = Direction.getById(netStream.readByte());
}
}