mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +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{
|
public static function read(PacketSerializer $in) : self{
|
||||||
$vec = new Vector3(0, 0, 0);
|
$x = $y = $z = 0;
|
||||||
$in->getSignedBlockPosition($vec->x, $vec->y, $vec->z);
|
$in->getSignedBlockPosition($x, $y, $z);
|
||||||
return new self($vec);
|
return new self(new Vector3($x, $y, $z));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function write(PacketSerializer $out) : void{
|
public function write(PacketSerializer $out) : void{
|
||||||
|
@ -87,8 +87,9 @@ class UseItemTransactionData extends TransactionData{
|
|||||||
|
|
||||||
protected function decodeData(PacketSerializer $stream) : void{
|
protected function decodeData(PacketSerializer $stream) : void{
|
||||||
$this->actionType = $stream->getUnsignedVarInt();
|
$this->actionType = $stream->getUnsignedVarInt();
|
||||||
$this->blockPos = new Vector3(0, 0, 0);
|
$x = $y = $z = 0;
|
||||||
$stream->getBlockPosition($this->blockPos->x, $this->blockPos->y, $this->blockPos->z);
|
$stream->getBlockPosition($x, $y, $z);
|
||||||
|
$this->blockPos = new Vector3($x, $y, $z);
|
||||||
$this->face = $stream->getVarInt();
|
$this->face = $stream->getVarInt();
|
||||||
$this->hotbarSlot = $stream->getVarInt();
|
$this->hotbarSlot = $stream->getVarInt();
|
||||||
$this->itemInHand = $stream->getSlot();
|
$this->itemInHand = $stream->getSlot();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user