mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Fixed crafting in some cases where item was replaced
This commit is contained in:
parent
97dd718e4f
commit
3e46fc1fdd
@ -1509,7 +1509,7 @@ class Player{
|
||||
if($data["windowid"] === 0){
|
||||
$craft = false;
|
||||
$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"]);
|
||||
$this->craftingItems[$data["slot"]] = $use;
|
||||
$craft = true;
|
||||
@ -1531,6 +1531,7 @@ class Player{
|
||||
$craft = true;
|
||||
}
|
||||
|
||||
|
||||
if($craft === true){
|
||||
$this->lastCraft = microtime(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user