mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Position: add getLevelNonNull()
this allows assuming that a position has a valid world in places where it's never expected to not be valid. Since this is the vast majority of usages, it eliminates a lot of possible null-pointer warnings given by static analysers. TODO: Consider whether we can make Position->getLevel/World use this behaviour out of the box in the next major version.
This commit is contained in:
@@ -56,7 +56,7 @@ class EnderChestInventory extends ChestInventory{
|
||||
*/
|
||||
public function setHolderPosition(EnderChest $enderChest){
|
||||
$this->holder->setComponents($enderChest->getFloorX(), $enderChest->getFloorY(), $enderChest->getFloorZ());
|
||||
$this->holder->setLevel($enderChest->getLevel());
|
||||
$this->holder->setLevel($enderChest->getLevelNonNull());
|
||||
}
|
||||
|
||||
protected function getOpenSound() : int{
|
||||
|
Reference in New Issue
Block a user