mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Heap of bugfixes, cleanup and PHP 7 upgrades
This commit is contained in:
@ -256,12 +256,12 @@ class CraftingManager{
|
||||
}
|
||||
|
||||
$hasRecipe = null;
|
||||
foreach($this->recipeLookup[$idx] as $recipe){
|
||||
if($recipe instanceof ShapelessRecipe){
|
||||
if($recipe->getIngredientCount() !== count($ingredients)){
|
||||
foreach($this->recipeLookup[$idx] as $possibleRecipe){
|
||||
if($possibleRecipe instanceof ShapelessRecipe){
|
||||
if($possibleRecipe->getIngredientCount() !== count($ingredients)){
|
||||
continue;
|
||||
}
|
||||
$checkInput = $recipe->getIngredientList();
|
||||
$checkInput = $possibleRecipe->getIngredientList();
|
||||
foreach($ingredients as $item){
|
||||
$amount = $item->getCount();
|
||||
foreach($checkInput as $k => $checkItem){
|
||||
@ -280,7 +280,7 @@ class CraftingManager{
|
||||
}
|
||||
|
||||
if(count($checkInput) === 0){
|
||||
$hasRecipe = $recipe;
|
||||
$hasRecipe = $possibleRecipe;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class ShapedRecipe implements Recipe{
|
||||
* @return null|Item
|
||||
*/
|
||||
public function getIngredient($x, $y){
|
||||
return isset($this->ingredients[$y][$x]) ? $this->ingredients[$y][$x] : Item::get(Item::AIR);
|
||||
return $this->ingredients[$y][$x] ?? Item::get(Item::AIR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,36 +28,36 @@ interface TransactionGroup{
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
function getCreationTime();
|
||||
public function getCreationTime();
|
||||
|
||||
/**
|
||||
* @return Transaction[]
|
||||
*/
|
||||
function getTransactions();
|
||||
public function getTransactions();
|
||||
|
||||
/**
|
||||
* @return Inventory[]
|
||||
*/
|
||||
function getInventories();
|
||||
public function getInventories();
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
*/
|
||||
function addTransaction(Transaction $transaction);
|
||||
public function addTransaction(Transaction $transaction);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function canExecute();
|
||||
public function canExecute();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function execute();
|
||||
public function execute();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function hasExecuted();
|
||||
public function hasExecuted();
|
||||
|
||||
}
|
Reference in New Issue
Block a user