mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Removed entanglement between chunks and providers. WARNING: BREAKING API CHANGES.
- All entity and tile constructors now require a \pocketmine\level\Level instead of a \pocketmine\level\format\Chunk. - Chunk->getProvider() and Chunk->setProvider() have been removed. - Chunk::__construct() has had the $provider parameter removed. - Chunk->unload() has had the unused $save parameter removed. - ChunkEvents now take a Level parameter instead of going through the Chunk API bump to 3.0.0-ALPHA4
This commit is contained in:
@ -1726,7 +1726,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->server->saveOfflinePlayerData($this->username, $nbt, true);
|
||||
}
|
||||
|
||||
parent::__construct($this->level->getChunk($nbt["Pos"][0] >> 4, $nbt["Pos"][2] >> 4, true), $nbt);
|
||||
parent::__construct($this->level, $nbt);
|
||||
$this->loggedIn = true;
|
||||
$this->server->addOnlinePlayer($this);
|
||||
|
||||
@ -2115,7 +2115,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
]);
|
||||
|
||||
$f = 1.5;
|
||||
$snowball = Entity::createEntity("Snowball", $this->chunk, $nbt, $this);
|
||||
$snowball = Entity::createEntity("Snowball", $this->getLevel(), $nbt, $this);
|
||||
$snowball->setMotion($snowball->getMotion()->multiply($f));
|
||||
if($this->isSurvival()){
|
||||
$item->setCount($item->getCount() - 1);
|
||||
@ -2200,7 +2200,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$diff = ($this->server->getTick() - $this->startAction);
|
||||
$p = $diff / 20;
|
||||
$f = min((($p ** 2) + $p * 2) / 3, 1) * 2;
|
||||
$ev = new EntityShootBowEvent($this, $bow, Entity::createEntity("Arrow", $this->chunk, $nbt, $this, $f == 2 ? true : false), $f);
|
||||
$ev = new EntityShootBowEvent($this, $bow, Entity::createEntity("Arrow", $this->getLevel(), $nbt, $this, $f == 2 ? true : false), $f);
|
||||
|
||||
if($f < 0.1 or $diff < 5){
|
||||
$ev->setCancelled();
|
||||
|
Reference in New Issue
Block a user