mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
InventoryAction: replace isValid() with validate() which throws TransactionValidationException
This commit is contained in:
@ -142,8 +142,10 @@ class InventoryTransaction{
|
||||
$needItems[] = $action->getTargetItem();
|
||||
}
|
||||
|
||||
if(!$action->isValid($this->source)){
|
||||
throw new TransactionValidationException("Action " . get_class($action) . " is not valid in the current transaction");
|
||||
try{
|
||||
$action->validate($this->source);
|
||||
}catch(TransactionValidationException $e){
|
||||
throw new TransactionValidationException(get_class($action) . ": " . $e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
if(!$action->getSourceItem()->isNull()){
|
||||
|
Reference in New Issue
Block a user