mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 02:21:46 +00:00
Give creative players carte blanche
Close #879, close #431 This will be solved properly in 1.2 when creative transactions are actually trackable. For now... HACK!
This commit is contained in:
parent
23eb8600ab
commit
44f1dedbf8
@ -139,21 +139,7 @@ class SimpleTransactionGroup implements TransactionGroup{
|
|||||||
$haveItems = [];
|
$haveItems = [];
|
||||||
$needItems = [];
|
$needItems = [];
|
||||||
|
|
||||||
if($this->matchItems($needItems, $haveItems) and count($this->transactions) > 0){
|
return $this->matchItems($needItems, $haveItems) and count($this->transactions) > 0 and ((count($haveItems) === 0 and count($needItems) === 0) or $this->source->isCreative(true));
|
||||||
if(count($haveItems) === 0 and count($needItems) === 0){
|
|
||||||
return true;
|
|
||||||
}elseif($this->source->isCreative(true) and count($needItems) > 0){ //Added items from creative inventory
|
|
||||||
foreach($needItems as $item){
|
|
||||||
if(Item::getCreativeItemIndex($item) === -1 and $item->getId() !== Item::AIR){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user