112        $world = $this->position->getWorld();
 
  113        if(($dyeColor = match($item->getTypeId()){
 
  114                ItemTypeIds::LAPIS_LAZULI => DyeColor::BLUE,
 
  115                ItemTypeIds::INK_SAC => DyeColor::BLACK,
 
  116                ItemTypeIds::COCOA_BEANS => DyeColor::BROWN,
 
  117                ItemTypeIds::BONE_MEAL => DyeColor::WHITE,
 
  118                ItemTypeIds::DYE => $item instanceof Dye ? $item->getColor() : null,
 
  120            }) !== 
null && ($newColor = $dyeColor->getRgbValue())->toRGBA() !== $this->customWaterColor?->toRGBA()
 
  122            $world->setBlock($this->position, $this->setCustomWaterColor($this->customWaterColor === null ? $newColor : Color::mix($this->customWaterColor, $newColor)));
 
  123            $world->addSound($this->position->add(0.5, 0.5, 0.5), new CauldronAddDyeSound());
 
  127            if($item->getType() === PotionType::WATER){
 
  128                $this->setCustomWaterColor(
null)->addFillLevels(self::WATER_BOTTLE_FILL_AMOUNT, $item, VanillaItems::GLASS_BOTTLE(), $returnedItems);
 
  130                $this->mix($item, VanillaItems::GLASS_BOTTLE(), $returnedItems);
 
  132        }elseif($item instanceof 
Armor){
 
  133            if($this->customWaterColor !== 
null){
 
  134                if(match($item->getTypeId()){ 
 
  135                    ItemTypeIds::LEATHER_CAP,
 
  136                    ItemTypeIds::LEATHER_TUNIC,
 
  137                    ItemTypeIds::LEATHER_PANTS,
 
  138                    ItemTypeIds::LEATHER_BOOTS => true,
 
  140                } && $item->getCustomColor()?->toRGBA() !== $this->customWaterColor->toRGBA()){
 
  141                    $item->setCustomColor($this->customWaterColor);
 
  142                    $world->setBlock($this->position, $this->withFillLevel($this->getFillLevel() - self::DYE_ARMOR_USE_AMOUNT));
 
  145            }elseif($item->getCustomColor() !== 
null){
 
  146                $item->clearCustomColor();
 
  147                $world->setBlock($this->position, $this->withFillLevel($this->getFillLevel() - self::CLEAN_ARMOR_USE_AMOUNT));
 
  148                $world->addSound($this->position->add(0.5, 0.5, 0.5), 
new CauldronCleanItemSound());
 
  150        }elseif($item instanceof Banner){
 
  151            $patterns = $item->getPatterns();
 
  152            if(count($patterns) > 0 && $this->customWaterColor === 
null){
 
  153                array_pop($patterns);
 
  154                $item->setPatterns($patterns);
 
  156                $world->setBlock($this->position, $this->withFillLevel($this->getFillLevel() - self::CLEAN_BANNER_USE_AMOUNT));
 
  157                $world->addSound($this->position->add(0.5, 0.5, 0.5), 
new CauldronCleanItemSound());
 
  159        }elseif(ItemTypeIds::toBlockTypeId($item->getTypeId()) === BlockTypeIds::DYED_SHULKER_BOX){
 
  160            if($this->customWaterColor === 
null){
 
  161                $newItem = VanillaBlocks::SHULKER_BOX()->asItem();
 
  165                $returnedItems[] = $newItem;
 
  167                $world->setBlock($this->position, $this->withFillLevel($this->getFillLevel() - self::CLEAN_SHULKER_BOX_USE_AMOUNT));
 
  168                $world->addSound($this->position->add(0.5, 0.5, 0.5), 
new CauldronCleanItemSound());
 
  171            match($item->getTypeId()){
 
  172                ItemTypeIds::WATER_BUCKET => $this->setCustomWaterColor(
null)->addFillLevels(self::MAX_FILL_LEVEL, $item, VanillaItems::BUCKET(), $returnedItems),
 
  173                ItemTypeIds::BUCKET => $this->removeFillLevels(self::MAX_FILL_LEVEL, $item, VanillaItems::WATER_BUCKET(), $returnedItems),
 
  174                ItemTypeIds::GLASS_BOTTLE => $this->removeFillLevels(self::WATER_BOTTLE_FILL_AMOUNT, $item, VanillaItems::POTION()->setType(PotionType::WATER), $returnedItems),
 
  175                ItemTypeIds::LAVA_BUCKET, ItemTypeIds::POWDER_SNOW_BUCKET => $this->mix($item, VanillaItems::BUCKET(), $returnedItems),