mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Modified Level and Chunk deprecated methods
This commit is contained in:
parent
232bf5ebe4
commit
269a10fadd
@ -61,7 +61,7 @@ class SetWorldSpawnCommand extends VanillaCommand{
|
||||
return true;
|
||||
}
|
||||
|
||||
$level->setSpawn($pos);
|
||||
$level->setSpawnLocation($pos);
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Set world " . $level->getName() . "'s spawnpoint to " . $pos->x . ", " . $pos->y . ", " . $pos->z);
|
||||
|
||||
|
@ -148,7 +148,7 @@ abstract class Entity extends Position implements Metadatable{
|
||||
|
||||
|
||||
public function __construct(FullChunk $chunk, Compound $nbt){
|
||||
if($chunk->getLevel() === null){
|
||||
if($chunk->getProvider() === null){
|
||||
throw new \Exception("Invalid garbage Chunk given to Entity");
|
||||
}
|
||||
|
||||
@ -156,21 +156,23 @@ abstract class Entity extends Position implements Metadatable{
|
||||
$this->justCreated = true;
|
||||
$this->namedtag = $nbt;
|
||||
$this->chunk = $chunk;
|
||||
$this->setLevel($chunk->getLevel()->getLevel(), true); //Create a hard reference
|
||||
$this->server = $chunk->getLevel()->getLevel()->getServer();
|
||||
$this->setLevel($chunk->getProvider()->getLevel(), true); //Create a hard reference
|
||||
$this->server = $chunk->getProvider()->getLevel()->getServer();
|
||||
|
||||
$this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
$this->setPositionAndRotation(new Vector3(
|
||||
$this->setPositionAndRotation(
|
||||
new Vector3(
|
||||
$this->namedtag["Pos"][0],
|
||||
$this->namedtag["Pos"][1],
|
||||
$this->namedtag["Pos"][2]),
|
||||
$this->namedtag["Pos"][2]
|
||||
),
|
||||
$this->namedtag->Rotation[0],
|
||||
$this->namedtag->Rotation[1]
|
||||
);
|
||||
$this->setMotion(new Vector3(
|
||||
$this->namedtag["Motion"][0],
|
||||
$this->namedtag["Motion"][1],
|
||||
$this->namedtag["Motion"][2])
|
||||
$this->namedtag["Motion"][0],
|
||||
$this->namedtag["Motion"][1],
|
||||
$this->namedtag["Motion"][2])
|
||||
);
|
||||
|
||||
if(!isset($this->namedtag->FallDistance)){
|
||||
@ -235,6 +237,9 @@ abstract class Entity extends Position implements Metadatable{
|
||||
|
||||
protected abstract function initEntity();
|
||||
|
||||
/**
|
||||
* @return Player[]
|
||||
*/
|
||||
public function getViewers(){
|
||||
return $this->hasSpawned;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ abstract class ChunkEvent extends LevelEvent{
|
||||
* @param FullChunk $chunk
|
||||
*/
|
||||
public function __construct(FullChunk $chunk){
|
||||
parent::__construct($chunk->getLevel()->getLevel());
|
||||
parent::__construct($chunk->getProvider()->getLevel());
|
||||
$this->chunk = $chunk;
|
||||
}
|
||||
|
||||
|
@ -64,13 +64,13 @@ abstract class Tile extends Position{
|
||||
public $tickTimer;
|
||||
|
||||
public function __construct(FullChunk $chunk, Compound $nbt){
|
||||
if($chunk->getLevel() === null){
|
||||
if($chunk->getProvider() === null){
|
||||
throw new \Exception("Invalid garbage Chunk given to Tile");
|
||||
}
|
||||
|
||||
$this->server = $chunk->getLevel()->getLevel()->getServer();
|
||||
$this->server = $chunk->getProvider()->getLevel()->getServer();
|
||||
$this->chunk = $chunk;
|
||||
$this->setLevel($chunk->getLevel()->getLevel(), true); //Strong reference
|
||||
$this->setLevel($chunk->getProvider()->getLevel(), true); //Strong reference
|
||||
$this->namedtag = $nbt;
|
||||
$this->closed = false;
|
||||
$this->name = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user