Small fix for ItemFrame
This commit is contained in:
parent
7a4e7b505f
commit
0c864affc1
3 changed files with 13 additions and 1 deletions
|
|
@ -2436,7 +2436,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
$tile->setItem(Item::get(Item::AIR));
|
||||
$tile->setItemRotation(0);
|
||||
}
|
||||
}
|
||||
}else $tile->spawnTo($this);
|
||||
}
|
||||
break;
|
||||
case ProtocolInfo::REQUEST_CHUNK_RADIUS_PACKET:
|
||||
|
|
|
|||
|
|
@ -1462,6 +1462,16 @@ abstract class Entity extends Location implements Metadatable{
|
|||
}
|
||||
}
|
||||
|
||||
public function setLocation(Location $pos){
|
||||
if($this->closed){
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setPositionAndRotation($pos, $pos->yaw, $pos->pitch);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setPosition(Vector3 $pos){
|
||||
if($this->closed){
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ class Location extends Position{
|
|||
* @param Level|null $level default null
|
||||
* @param float $yaw default 0.0
|
||||
* @param float $pitch default 0.0
|
||||
*
|
||||
* @return Location
|
||||
*/
|
||||
public static function fromObject(Vector3 $pos, Level $level = null, $yaw = 0.0, $pitch = 0.0){
|
||||
return new Location($pos->x, $pos->y, $pos->z, $yaw, $pitch, ($level === null) ? (($pos instanceof Position) ? $pos->level : null) : $level);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue