mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
updated pocketmine/nbt dependency
this is going to need work on exception handling, but right now it's so inconsistent that it doesn't matter anyway.
This commit is contained in:
@ -45,7 +45,7 @@ class Comparator extends Tile{
|
||||
}
|
||||
|
||||
public function readSaveData(CompoundTag $nbt) : void{
|
||||
$this->signalStrength = $nbt->getInt(self::TAG_OUTPUT_SIGNAL, 0, true);
|
||||
$this->signalStrength = $nbt->getInt(self::TAG_OUTPUT_SIGNAL, 0);
|
||||
}
|
||||
|
||||
protected function writeSaveData(CompoundTag $nbt) : void{
|
||||
|
@ -66,14 +66,14 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
}
|
||||
|
||||
public function readSaveData(CompoundTag $nbt) : void{
|
||||
$this->remainingFuelTime = max(0, $nbt->getShort(self::TAG_BURN_TIME, $this->remainingFuelTime, true));
|
||||
$this->remainingFuelTime = max(0, $nbt->getShort(self::TAG_BURN_TIME, $this->remainingFuelTime));
|
||||
|
||||
$this->cookTime = $nbt->getShort(self::TAG_COOK_TIME, $this->cookTime, true);
|
||||
$this->cookTime = $nbt->getShort(self::TAG_COOK_TIME, $this->cookTime);
|
||||
if($this->remainingFuelTime === 0){
|
||||
$this->cookTime = 0;
|
||||
}
|
||||
|
||||
$this->maxFuelTime = $nbt->getShort(self::TAG_MAX_TIME, $this->maxFuelTime, true);
|
||||
$this->maxFuelTime = $nbt->getShort(self::TAG_MAX_TIME, $this->maxFuelTime);
|
||||
if($this->maxFuelTime === 0){
|
||||
$this->maxFuelTime = $this->remainingFuelTime;
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ class ItemFrame extends Spawnable{
|
||||
if(($itemTag = $nbt->getCompoundTag(self::TAG_ITEM)) !== null){
|
||||
$this->item = Item::nbtDeserialize($itemTag);
|
||||
}
|
||||
$this->itemRotation = $nbt->getByte(self::TAG_ITEM_ROTATION, $this->itemRotation, true);
|
||||
$this->itemDropChance = $nbt->getFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance, true);
|
||||
$this->itemRotation = $nbt->getByte(self::TAG_ITEM_ROTATION, $this->itemRotation);
|
||||
$this->itemDropChance = $nbt->getFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
|
||||
}
|
||||
|
||||
protected function writeSaveData(CompoundTag $nbt) : void{
|
||||
|
@ -58,7 +58,7 @@ class Skull extends Spawnable{
|
||||
//bad data, drop it
|
||||
}
|
||||
}
|
||||
$rotation = $nbt->getByte(self::TAG_ROT, 0, true);
|
||||
$rotation = $nbt->getByte(self::TAG_ROT, 0);
|
||||
if($rotation >= 0 and $rotation <= 15){
|
||||
$this->skullRotation = $rotation;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ final class TileFactory{
|
||||
* @internal
|
||||
*/
|
||||
public static function createFromData(World $world, CompoundTag $nbt) : ?Tile{
|
||||
$type = $nbt->getString(Tile::TAG_ID, "", true);
|
||||
$type = $nbt->getString(Tile::TAG_ID, "");
|
||||
if(!isset(self::$knownTiles[$type])){
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user