mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +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;
|
||||
case Entity::DATA_TYPE_POS:
|
||||
//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;
|
||||
case Entity::DATA_TYPE_LONG:
|
||||
$stream->putVarInt($d[1]); //TODO: varint64 support
|
||||
@ -165,14 +167,17 @@ class Binary{
|
||||
break;
|
||||
case Entity::DATA_TYPE_SLOT:
|
||||
//TODO: use objects directly
|
||||
$value = [];
|
||||
$item = $stream->getSlot();
|
||||
$value[0] = $item->getId();
|
||||
$value[1] = $item->getCount();
|
||||
$value[2] = $item->getDamage();
|
||||
break;
|
||||
case Entity::DATA_TYPE_POS:
|
||||
$value = [0, 0, 0];
|
||||
$stream->getBlockCoords($value[0], $value[1], $value[2]);
|
||||
$value = [];
|
||||
$value[0] = $stream->getVarInt(); //x
|
||||
$value[1] = $stream->getVarInt(); //y (SIGNED)
|
||||
$value[2] = $stream->getVarInt(); //z
|
||||
break;
|
||||
case Entity::DATA_TYPE_LONG:
|
||||
$value = $stream->getVarInt(); //TODO: varint64 proper support
|
||||
|
Loading…
x
Reference in New Issue
Block a user