mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
Revert Armor then Inventory instead of Inventory then Armor on failed transaction
This commit is contained in:
parent
413bd3c0df
commit
da4334f06b
@ -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 === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 0.4)){
|
||||||
if($this->currentTransaction instanceof SimpleTransactionGroup){
|
if($this->currentTransaction instanceof SimpleTransactionGroup){
|
||||||
foreach($this->currentTransaction->getInventories() as $inventory){
|
foreach($this->currentTransaction->getInventories() as $inventory){
|
||||||
$inventory->sendContents($inventory->getViewers());
|
|
||||||
if($inventory instanceof PlayerInventory){
|
if($inventory instanceof PlayerInventory){
|
||||||
$inventory->sendArmorContents($inventory->getViewers());
|
$inventory->sendArmorContents($this);
|
||||||
}
|
}
|
||||||
|
$inventory->sendContents($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->currentTransaction = new SimpleTransactionGroup($this);
|
$this->currentTransaction = new SimpleTransactionGroup($this);
|
||||||
|
@ -141,10 +141,10 @@ class SimpleTransactionGroup implements TransactionGroup{
|
|||||||
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
|
Server::getInstance()->getPluginManager()->callEvent($ev = new InventoryTransactionEvent($this));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
foreach($this->inventories as $inventory){
|
foreach($this->inventories as $inventory){
|
||||||
$inventory->sendContents($inventory->getViewers());
|
|
||||||
if($inventory instanceof PlayerInventory){
|
if($inventory instanceof PlayerInventory){
|
||||||
$inventory->sendArmorContents($inventory->getViewers());
|
$inventory->sendArmorContents($this->getSource());
|
||||||
}
|
}
|
||||||
|
$inventory->sendContents($this->getSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user