fix item frames

This commit is contained in:
Dylan K. Taylor 2022-06-25 16:10:06 +01:00
parent f57e02849a
commit db8bf672f0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -58,7 +58,9 @@ class ItemFrame extends Spawnable{
protected function writeSaveData(CompoundTag $nbt) : void{
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
$nbt->setByte(self::TAG_ITEM_ROTATION, $this->itemRotation);
$nbt->setTag(self::TAG_ITEM, $this->item->nbtSerialize());
if(!$this->item->isNull()){
$nbt->setTag(self::TAG_ITEM, $this->item->nbtSerialize());
}
}
public function hasItem() : bool{
@ -96,6 +98,8 @@ class ItemFrame extends Spawnable{
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
$nbt->setByte(self::TAG_ITEM_ROTATION, $this->itemRotation);
$nbt->setTag(self::TAG_ITEM, $this->item->nbtSerialize());
if(!$this->item->isNull()){
$nbt->setTag(self::TAG_ITEM, $this->item->nbtSerialize());
}
}
}