Fixed crafting in some cases where item was replaced

This commit is contained in:
Shoghi Cervantes 2013-06-08 13:11:16 +02:00
parent 97dd718e4f
commit 3e46fc1fdd

View File

@ -1509,7 +1509,7 @@ class Player{
if($data["windowid"] === 0){ if($data["windowid"] === 0){
$craft = false; $craft = false;
$slot = $this->getSlot($data["slot"]); $slot = $this->getSlot($data["slot"]);
if($slot->count >= $data["stack"] and $slot->getID() === $data["block"] and $slot->getMetadata() === $data["meta"] and !isset($this->craftingItems[$data["slot"]])){ //Crafting recipe if($slot->count >= $data["stack"] and (($slot->getID() === $data["block"] and $slot->getMetadata() === $data["meta"]) or ($data["block"] === AIR and $data["stack"] === 0)) and !isset($this->craftingItems[$data["slot"]])){ //Crafting recipe
$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;
@ -1531,6 +1531,7 @@ class Player{
$craft = true; $craft = true;
} }
if($craft === true){ if($craft === true){
$this->lastCraft = microtime(true); $this->lastCraft = microtime(true);
} }