Revert Armor then Inventory instead of Inventory then Armor on failed transaction

This commit is contained in:
Shoghi Cervantes 2014-11-01 23:02:59 +01:00
parent 413bd3c0df
commit da4334f06b
2 changed files with 4 additions and 4 deletions

View File

@ -2129,10 +2129,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 0.4)){
if($this->currentTransaction instanceof SimpleTransactionGroup){
foreach($this->currentTransaction->getInventories() as $inventory){
$inventory->sendContents($inventory->getViewers());
if($inventory instanceof PlayerInventory){
$inventory->sendArmorContents($inventory->getViewers());
$inventory->sendArmorContents($this);
}
$inventory->sendContents($this);
}
}
$this->currentTransaction = new SimpleTransactionGroup($this);

View File

@ -141,10 +141,10 @@ class SimpleTransactionGroup implements TransactionGroup{
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
if($ev->isCancelled()){
foreach($this->inventories as $inventory){
$inventory->sendContents($inventory->getViewers());
if($inventory instanceof PlayerInventory){
$inventory->sendArmorContents($inventory->getViewers());
$inventory->sendArmorContents($this->getSource());
}
$inventory->sendContents($this->getSource());
}
return false;