Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-04-28 21:00:23 +01:00
16 changed files with 116 additions and 64 deletions

View File

@ -44,7 +44,7 @@ trait ContainerTrait{
abstract public function getRealInventory();
protected function loadItems(CompoundTag $tag) : void{
if(($inventoryTag = $tag->getTag(Container::TAG_ITEMS)) instanceof ListTag){
if(($inventoryTag = $tag->getTag(Container::TAG_ITEMS)) instanceof ListTag && $inventoryTag->getTagType() === NBT::TAG_Compound){
$inventory = $this->getRealInventory();
$listeners = $inventory->getListeners()->toArray();
$inventory->getListeners()->remove(...$listeners); //prevent any events being fired by initialization