Fix metadata block coords (signed Y coordinate), close #286

This commit is contained in:
Dylan K. Taylor 2017-01-23 13:11:39 +00:00
parent 9c36e0cd1c
commit 75a38699e2

View File

@ -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