mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Fixed recipe mixture
This commit is contained in:
parent
67b0b97005
commit
0bd8d0b0d0
@ -74,6 +74,7 @@ class Player{
|
||||
private $packetStats;
|
||||
public $craftingItems = array();
|
||||
public $toCraft = array();
|
||||
public $lastCraft = 0;
|
||||
|
||||
public function __get($name){
|
||||
if(isset($this->{$name})){
|
||||
@ -642,7 +643,7 @@ class Player{
|
||||
}
|
||||
|
||||
$res = CraftingRecipes::canCraft($craftItem, $recipeItems, $type);
|
||||
|
||||
|
||||
if(!is_array($res) and $type === 1){
|
||||
$res2 = CraftingRecipes::canCraft($craftItem, $recipeItems, 0);
|
||||
if(is_array($res2)){
|
||||
@ -663,7 +664,7 @@ class Player{
|
||||
if($s->count <= 0 or $s->getID() === AIR){
|
||||
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $item->count));
|
||||
}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;
|
||||
}
|
||||
|
||||
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){
|
||||
$craft = false;
|
||||
$slot = $this->getSlot($data["slot"]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user