Commit 8b113db9 authored by CortexPE's avatar CortexPE Committed by GitHub
Browse files

Merge pull request #803 from TheAz928/patch-2

Add Transaction::getSourceItem()

(This is used for GUIs btw 😉)
parents 4b44cc30 364eeb53
Pipeline #11600850 failed with stage
in 54 seconds
......@@ -85,6 +85,13 @@ class BaseTransaction implements Transaction {
public function getTargetItem(){
return clone $this->targetItem;
}
/**
* @return Item
*/
public function getSourceItem(){
return clone $this->inventory->getItem($this->slot);
}
/**
* @param Item $item
......@@ -262,4 +269,4 @@ class BaseTransaction implements Transaction {
return true;
}
}
\ No newline at end of file
}
......@@ -44,6 +44,11 @@ interface Transaction {
* @return Item
*/
public function getTargetItem();
/**
* @return Item
*/
public function getSourceItem();
/**
* @return float
......@@ -56,4 +61,4 @@ interface Transaction {
* @return bool
*/
public function execute(Player $source) : bool;
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment