mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Spawnable: explicitly assume that NBTStream->write() will not return false
it will never return false under these circumstances
This commit is contained in:
parent
755919c496
commit
bbe428a874
@ -30,6 +30,7 @@ use pocketmine\nbt\tag\IntTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\network\mcpe\protocol\BlockActorDataPacket;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
|
||||
abstract class Spawnable extends Tile{
|
||||
/** @var string|null */
|
||||
@ -96,7 +97,9 @@ abstract class Spawnable extends Tile{
|
||||
self::$nbtWriter = new NetworkLittleEndianNBTStream();
|
||||
}
|
||||
|
||||
$this->spawnCompoundCache = self::$nbtWriter->write($this->getSpawnCompound());
|
||||
$spawnCompoundCache = self::$nbtWriter->write($this->getSpawnCompound());
|
||||
if($spawnCompoundCache === false) throw new AssumptionFailedError("NBTStream->write() should not return false when given a CompoundTag");
|
||||
$this->spawnCompoundCache = $spawnCompoundCache;
|
||||
}
|
||||
|
||||
return $this->spawnCompoundCache;
|
||||
|
Loading…
x
Reference in New Issue
Block a user