mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
tweaked crafting
This commit is contained in:
parent
9e9dd532a3
commit
15740c3e53
2 changed files with 73 additions and 14 deletions
|
|
@ -2722,15 +2722,18 @@ class Player{
|
|||
|
||||
$results = [];
|
||||
foreach($this->toCraft as $i => $slotz){
|
||||
$results[$i >> 16] = [$i >> 16, $i & 0xffff, array_sum($slotz)];
|
||||
if(!isset($results[$i])) $results[$i] = [];
|
||||
$results[$i >> 16][] = [$i >> 16, $i & 0xffff, array_sum($slotz)];
|
||||
}
|
||||
$ingridients = [];
|
||||
foreach($this->craftingItems as $i => $slotz){
|
||||
$ingridients[$i >> 16] = [$i >> 16, $i & 0xffff, array_sum($slotz)];
|
||||
if(!isset($ingridients[$i])) $ingridients[$i] = [];
|
||||
$ingridients[$i >> 16][] = [$i >> 16, $i & 0xffff, array_sum($slotz)];
|
||||
}
|
||||
|
||||
|
||||
$cc = CraftingRecipes::canCraft($results, $ingridients, $this->craftingType);
|
||||
|
||||
if(!is_array($cc)){
|
||||
if($this->craftingType == CraftingRecipes::TYPE_CRAFTIGTABLE){
|
||||
$cc = CraftingRecipes::canCraft($results, $ingridients, CraftingRecipes::TYPE_INVENTORY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue