mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Added CraftingManager::getCraftingRecipeFromIndex()
This commit is contained in:
parent
34ced382db
commit
4864444440
@ -167,6 +167,10 @@ class CraftingManager{
|
||||
return $this->craftingRecipeIndex;
|
||||
}
|
||||
|
||||
public function getCraftingRecipeFromIndex(int $index) : ?CraftingRecipe{
|
||||
return $this->craftingRecipeIndex[$index] ?? null;
|
||||
}
|
||||
|
||||
public function getFurnaceRecipeManager(FurnaceType $furnaceType) : FurnaceRecipeManager{
|
||||
return $this->furnaceRecipeManagers[$furnaceType->id()];
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ final class ItemStackRequestExecutor{
|
||||
throw new PacketHandlingException("Cannot craft a recipe less than 1 time");
|
||||
}
|
||||
$craftingManager = $this->player->getServer()->getCraftingManager();
|
||||
$recipe = $craftingManager->getCraftingRecipeIndex()[$recipeId] ?? null;
|
||||
$recipe = $craftingManager->getCraftingRecipeFromIndex($recipeId);
|
||||
if($recipe === null){
|
||||
throw new PacketHandlingException("Unknown crafting recipe ID $recipeId");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user