mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
fix item frames
This commit is contained in:
parent
f57e02849a
commit
db8bf672f0
@ -58,7 +58,9 @@ class ItemFrame extends Spawnable{
|
|||||||
protected function writeSaveData(CompoundTag $nbt) : void{
|
protected function writeSaveData(CompoundTag $nbt) : void{
|
||||||
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
|
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
|
||||||
$nbt->setByte(self::TAG_ITEM_ROTATION, $this->itemRotation);
|
$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{
|
public function hasItem() : bool{
|
||||||
@ -96,6 +98,8 @@ class ItemFrame extends Spawnable{
|
|||||||
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
|
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
|
||||||
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
|
$nbt->setFloat(self::TAG_ITEM_DROP_CHANCE, $this->itemDropChance);
|
||||||
$nbt->setByte(self::TAG_ITEM_ROTATION, $this->itemRotation);
|
$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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user