Fixed recipe mixture

This commit is contained in:
Shoghi Cervantes 2013-06-06 19:31:15 +02:00
parent 67b0b97005
commit 0bd8d0b0d0

View File

@ -74,6 +74,7 @@ class Player{
private $packetStats; private $packetStats;
public $craftingItems = array(); public $craftingItems = array();
public $toCraft = array(); public $toCraft = array();
public $lastCraft = 0;
public function __get($name){ public function __get($name){
if(isset($this->{$name})){ if(isset($this->{$name})){
@ -663,7 +664,7 @@ class Player{
if($s->count <= 0 or $s->getID() === AIR){ if($s->count <= 0 or $s->getID() === AIR){
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $item->count)); $this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $item->count));
}else{ }else{
$s->count += $item->count; $this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $s->count + $item->count));
} }
} }
} }
@ -1462,6 +1463,15 @@ class Player{
break; break;
} }
if($this->lastCraft <= (microtime(true) - 1)){
if(isset($this->toCraft[-1])){
$this->toCraft = array(-1 => $this->toCraft[-1]);
}else{
$this->toCraft = array();
}
$this->craftingItems = array();
}
if($data["windowid"] === 0){ if($data["windowid"] === 0){
$craft = false; $craft = false;
$slot = $this->getSlot($data["slot"]); $slot = $this->getSlot($data["slot"]);