mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Fix crafting not taking item from inventory
This commit is contained in:
parent
c7c78b1159
commit
d5f3c19054
@ -52,7 +52,7 @@ class CraftingManager{
|
|||||||
private static $RECIPE_COUNT = 0;
|
private static $RECIPE_COUNT = 0;
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
// load recipes from src/pocketmine/recipes.json
|
// load recipes from src/pocketmine/recipes.json
|
||||||
$recipes = new Config(Server::getInstance()->getFilePath() . "src/pocketmine/resources/recipes.json", Config::JSON, []);
|
$recipes = new Config(Server::getInstance()->getFilePath() . "src/pocketmine/resources/recipes.json", Config::JSON, []);
|
||||||
|
|
||||||
MainLogger::getLogger()->Info("Loading recipes...");
|
MainLogger::getLogger()->Info("Loading recipes...");
|
||||||
@ -88,7 +88,7 @@ class CraftingManager{
|
|||||||
case 2:
|
case 2:
|
||||||
$result = $recipe["Result"];
|
$result = $recipe["Result"];
|
||||||
$resultItem = Item::get($result["ID"], $result["Damage"], $result["Count"]);
|
$resultItem = Item::get($result["ID"], $result["Damage"], $result["Count"]);
|
||||||
$this->registerRecipe(new FurnaceRecipe($resultItem, Item::get($recipe["Ingredients"], 0,1)));
|
$this->registerRecipe(new FurnaceRecipe($resultItem, Item::get($recipe["Ingredients"], 0, 1)));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$result = $recipe["Result"];
|
$result = $recipe["Result"];
|
||||||
|
@ -1525,7 +1525,7 @@ class Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{
|
public final function deepEquals(Item $item, bool $checkDamage = true, bool $checkCompound = true) : bool{
|
||||||
if($item->equals($item, $checkDamage, $checkCompound)){
|
if($this->equals($item, $checkDamage, $checkCompound)){
|
||||||
return true;
|
return true;
|
||||||
}elseif($item->hasCompoundTag() or $this->hasCompoundTag()){
|
}elseif($item->hasCompoundTag() or $this->hasCompoundTag()){
|
||||||
return NBT::matchTree($this->getNamedTag(), $item->getNamedTag());
|
return NBT::matchTree($this->getNamedTag(), $item->getNamedTag());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user