55        parent::writeStateToWorld();
 
   56        $tile = $this->position->getWorld()->getTile($this->position);
 
   57        assert($tile instanceof TileCauldron);
 
   58        $tile->setCustomWaterColor(
null);
 
   59        $tile->setPotionItem($this->potionItem);
 
 
   66        if($potionItem !== null && !match($potionItem->getTypeId()){
 
   68            ItemTypeIds::SPLASH_POTION,
 
   69            ItemTypeIds::LINGERING_POTION => 
true,
 
   72            throw new \InvalidArgumentException(
"Item must be a POTION, SPLASH_POTION or LINGERING_POTION");
 
   74        $this->potionItem = $potionItem !== 
null ? (clone $potionItem)->setCount(1) : 
null;
 
 
   90        if($this->potionItem !== null && !$usedItem->equals($this->potionItem, true, false)){
 
   91            $this->mix($usedItem, $returnedItem, $returnedItems);
 
   93            $this->addFillLevels($amount, $usedItem, $returnedItem, $returnedItems);
 
 
   98        match($item->getTypeId()){
 
   99            ItemTypeIds::LINGERING_POTION, ItemTypeIds::POTION, ItemTypeIds::SPLASH_POTION => $this->addFillLevelsOrMix(self::POTION_FILL_AMOUNT, $item, VanillaItems::GLASS_BOTTLE(), $returnedItems),
 
  100            ItemTypeIds::GLASS_BOTTLE => $this->potionItem === 
null ? null : $this->removeFillLevels(self::POTION_FILL_AMOUNT, $item, clone $this->potionItem, $returnedItems),
 
  101            ItemTypeIds::LAVA_BUCKET, ItemTypeIds::POWDER_SNOW_BUCKET, ItemTypeIds::WATER_BUCKET => $this->mix($item, VanillaItems::BUCKET(), $returnedItems),
 
 
  109        $world = $this->position->getWorld();
 
  110        if($world->getBlock($this->position->up())->getTypeId() === BlockTypeIds::WATER){
 
  111            $cauldron = VanillaBlocks::WATER_CAULDRON()->setFillLevel(FillableCauldron::MAX_FILL_LEVEL);
 
  112            $world->setBlock($this->position, $cauldron);
 
  113            $world->addSound($this->position->add(0.5, 0.5, 0.5), $cauldron->getFillSound());