diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 9a0735ea8..0634795ca 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -73,6 +73,7 @@ use pocketmine\level\format\LevelProvider; use pocketmine\level\Level; use pocketmine\level\Location; use pocketmine\level\Position; +use pocketmine\math\AxisAlignedBB; use pocketmine\math\Vector3; use pocketmine\metadata\MetadataValue; use pocketmine\nbt\NBT; diff --git a/src/pocketmine/block/Fallable.php b/src/pocketmine/block/Fallable.php index 448878fc9..2216fba21 100644 --- a/src/pocketmine/block/Fallable.php +++ b/src/pocketmine/block/Fallable.php @@ -63,7 +63,7 @@ abstract class Fallable extends Solid{ new Float("", 0) ]), "TileID" => new Int("TileID", $this->getID()), - "Data" => new Byte("Data", $this->getDamage()), + "TileData" => new Byte("TileData", $this->getDamage()), ])); $fall->spawnToAll(); diff --git a/src/pocketmine/entity/FallingSand.php b/src/pocketmine/entity/FallingSand.php index a4a0115bb..b1e32b263 100644 --- a/src/pocketmine/entity/FallingSand.php +++ b/src/pocketmine/entity/FallingSand.php @@ -58,6 +58,10 @@ class FallingSand extends Entity{ $this->namedtag["TileID"] = new Int("TileID", $this->blockId); } + if(isset($this->namedtag->TileData)){ + $this->damage = $this->namedtag["TileData"]; + } + if($this->blockId === 0){ $this->close(); } @@ -154,7 +158,7 @@ class FallingSand extends Entity{ $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; - $pk->did = -$this->getBlock(); + $pk->did = -($this->getBlock() | $this->getDamage() << 0x10); $player->dataPacket($pk); $pk = SetEntityMotionPacket::getFromPool();