mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fix metadata block coords (signed Y coordinate), close #286
This commit is contained in:
parent
9c36e0cd1c
commit
75a38699e2
@ -116,7 +116,9 @@ class Binary{
|
|||||||
break;
|
break;
|
||||||
case Entity::DATA_TYPE_POS:
|
case Entity::DATA_TYPE_POS:
|
||||||
//TODO: change this implementation (use objects)
|
//TODO: change this implementation (use objects)
|
||||||
$stream->putBlockCoords($d[1][0], $d[1][1], $d[1][2]); //x, y, z
|
$stream->putVarInt($d[1][0]); //x
|
||||||
|
$stream->putVarInt($d[1][1]); //y (SIGNED)
|
||||||
|
$stream->putVarInt($d[1][2]); //z
|
||||||
break;
|
break;
|
||||||
case Entity::DATA_TYPE_LONG:
|
case Entity::DATA_TYPE_LONG:
|
||||||
$stream->putVarInt($d[1]); //TODO: varint64 support
|
$stream->putVarInt($d[1]); //TODO: varint64 support
|
||||||
@ -165,14 +167,17 @@ class Binary{
|
|||||||
break;
|
break;
|
||||||
case Entity::DATA_TYPE_SLOT:
|
case Entity::DATA_TYPE_SLOT:
|
||||||
//TODO: use objects directly
|
//TODO: use objects directly
|
||||||
|
$value = [];
|
||||||
$item = $stream->getSlot();
|
$item = $stream->getSlot();
|
||||||
$value[0] = $item->getId();
|
$value[0] = $item->getId();
|
||||||
$value[1] = $item->getCount();
|
$value[1] = $item->getCount();
|
||||||
$value[2] = $item->getDamage();
|
$value[2] = $item->getDamage();
|
||||||
break;
|
break;
|
||||||
case Entity::DATA_TYPE_POS:
|
case Entity::DATA_TYPE_POS:
|
||||||
$value = [0, 0, 0];
|
$value = [];
|
||||||
$stream->getBlockCoords($value[0], $value[1], $value[2]);
|
$value[0] = $stream->getVarInt(); //x
|
||||||
|
$value[1] = $stream->getVarInt(); //y (SIGNED)
|
||||||
|
$value[2] = $stream->getVarInt(); //z
|
||||||
break;
|
break;
|
||||||
case Entity::DATA_TYPE_LONG:
|
case Entity::DATA_TYPE_LONG:
|
||||||
$value = $stream->getVarInt(); //TODO: varint64 proper support
|
$value = $stream->getVarInt(); //TODO: varint64 proper support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user