mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Fixed craftin recipes with wildcard
This commit is contained in:
parent
1179369666
commit
c1f79fa2f8
@ -1479,7 +1479,7 @@ class Player{
|
|||||||
$use = BlockAPI::getItem($slot->getID(), $slot->getMetadata(), $slot->count - $data["stack"]);
|
$use = BlockAPI::getItem($slot->getID(), $slot->getMetadata(), $slot->count - $data["stack"]);
|
||||||
$this->craftingItems[$data["slot"]] = $use;
|
$this->craftingItems[$data["slot"]] = $use;
|
||||||
$craft = true;
|
$craft = true;
|
||||||
}elseif($slot->count <= $data["stack"] and ($slot->getID() === AIR or $slot->getID() === $data["block"])){ //Crafting final
|
}elseif($slot->count <= $data["stack"] and ($slot->getID() === AIR or ($slot->getID() === $data["block"] and $slot->getMetadata() === $data["meta"]))){ //Crafting final
|
||||||
$craftItem = BlockAPI::getItem($data["block"], $data["meta"], $data["stack"] - $slot->count);
|
$craftItem = BlockAPI::getItem($data["block"], $data["meta"], $data["stack"] - $slot->count);
|
||||||
if(count($this->toCraft) === 0){
|
if(count($this->toCraft) === 0){
|
||||||
$this->toCraft[-1] = 0;
|
$this->toCraft[-1] = 0;
|
||||||
@ -1503,9 +1503,6 @@ class Player{
|
|||||||
|
|
||||||
if($craft === true and count($this->craftingItems) > 0 and count($this->toCraft) > 0 and ($recipe = $this->craftItems($this->toCraft, $this->craftingItems, $this->toCraft[-1])) !== true){
|
if($craft === true and count($this->craftingItems) > 0 and count($this->toCraft) > 0 and ($recipe = $this->craftItems($this->toCraft, $this->craftingItems, $this->toCraft[-1])) !== true){
|
||||||
if($recipe === false){
|
if($recipe === false){
|
||||||
$this->dataPacket(MC_CONTAINER_CLOSE, array(
|
|
||||||
"windowid" => 0,
|
|
||||||
));
|
|
||||||
$this->sendInventory();
|
$this->sendInventory();
|
||||||
$this->toCraft = array();
|
$this->toCraft = array();
|
||||||
}else{
|
}else{
|
||||||
|
@ -268,7 +268,7 @@ class CraftingRecipes{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$oitem = $recipeItems[$item[0]];
|
$oitem = $recipeItems[$item[0]];
|
||||||
if(($oitem[1] != $item[1] and $item[2] !== false) or $oitem[2] != $item[2]){
|
if(($oitem[1] != $item[1] and $item[1] !== false) or $oitem[2] != $item[2]){
|
||||||
$continue = false;
|
$continue = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user