mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
protocol: remove final remaining Vector3 mutations
this really should be replaced with a network layer BlockPos structure in the absence of a general int-vector structure in math.
This commit is contained in:
parent
a5e21bfaa9
commit
7c192f85e2
@ -44,9 +44,9 @@ final class BlockPosMetadataProperty implements MetadataProperty{
|
||||
}
|
||||
|
||||
public static function read(PacketSerializer $in) : self{
|
||||
$vec = new Vector3(0, 0, 0);
|
||||
$in->getSignedBlockPosition($vec->x, $vec->y, $vec->z);
|
||||
return new self($vec);
|
||||
$x = $y = $z = 0;
|
||||
$in->getSignedBlockPosition($x, $y, $z);
|
||||
return new self(new Vector3($x, $y, $z));
|
||||
}
|
||||
|
||||
public function write(PacketSerializer $out) : void{
|
||||
|
@ -87,8 +87,9 @@ class UseItemTransactionData extends TransactionData{
|
||||
|
||||
protected function decodeData(PacketSerializer $stream) : void{
|
||||
$this->actionType = $stream->getUnsignedVarInt();
|
||||
$this->blockPos = new Vector3(0, 0, 0);
|
||||
$stream->getBlockPosition($this->blockPos->x, $this->blockPos->y, $this->blockPos->z);
|
||||
$x = $y = $z = 0;
|
||||
$stream->getBlockPosition($x, $y, $z);
|
||||
$this->blockPos = new Vector3($x, $y, $z);
|
||||
$this->face = $stream->getVarInt();
|
||||
$this->hotbarSlot = $stream->getVarInt();
|
||||
$this->itemInHand = $stream->getSlot();
|
||||
|
Loading…
x
Reference in New Issue
Block a user