Cake: only accept candle when no slices have been taken

otherwise, cake slices can be regenerated using candle
This commit is contained in:
Dylan K. Taylor 2023-08-09 11:42:08 +01:00
parent 662f2495e9
commit f4a06605b1
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -64,7 +64,7 @@ class Cake extends BaseCake{
}
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
if($item instanceof ItemBlock){
if($this->bites === 0 && $item instanceof ItemBlock){
$block = $item->getBlock();
$resultBlock = null;
if($block->getTypeId() === BlockTypeIds::CANDLE){