better craft checking

This commit is contained in:
GameHerobrine 2025-05-19 11:24:41 +03:00
parent 75a6b66d29
commit b0bad174e0
2 changed files with 42 additions and 10 deletions

View file

@ -2803,7 +2803,13 @@ class Player{
$cc = CraftingRecipes::canCraft($results, $ingridients, $this->craftingType);
if(!is_array($cc)) return;
if(!is_array($cc)){
if(!$cc){
$this->toCraft = [];
$this->craftingItems = [];
}
return;
}
if($this->server->api->dhandle("player.craft", ["player" => $this, "ingridients" => $this->craftingItems, "results" => $this->toCraft, "type" => $this->craftingType]) === false){
$this->toCraft = [];