Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.

Commit a677bcb

Browse files
committed
Increased transaction timeout, not needed anymore due to packet ordering
1 parent 2f60073 commit a677bcb

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/pocketmine/Player.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,7 +2182,7 @@ public function handleDataPacket(DataPacket $packet){
21822182
}
21832183

21842184

2185-
if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 0.5)){
2185+
if($this->currentTransaction === null or $this->currentTransaction->getCreationTime() < (microtime(true) - 8)){
21862186
if($this->currentTransaction instanceof SimpleTransactionGroup){
21872187
foreach($this->currentTransaction->getInventories() as $inventory){
21882188
if($inventory instanceof PlayerInventory){
@@ -2197,19 +2197,16 @@ public function handleDataPacket(DataPacket $packet){
21972197
$this->currentTransaction->addTransaction($transaction);
21982198

21992199
if($this->currentTransaction->canExecute()){
2200-
if(!$this->currentTransaction->execute()){
2201-
$this->currentTransaction = null;
2202-
break;
2203-
}
2204-
2205-
foreach($this->currentTransaction->getTransactions() as $ts){
2206-
$inv = $ts->getInventory();
2207-
if($inv instanceof FurnaceInventory){
2208-
if($ts->getSlot() === 2){
2209-
switch($inv->getResult()->getId()){
2210-
case Item::IRON_INGOT:
2211-
$this->awardAchievement("acquireIron");
2212-
break;
2200+
if($this->currentTransaction->execute()){
2201+
foreach($this->currentTransaction->getTransactions() as $ts){
2202+
$inv = $ts->getInventory();
2203+
if($inv instanceof FurnaceInventory){
2204+
if($ts->getSlot() === 2){
2205+
switch($inv->getResult()->getId()){
2206+
case Item::IRON_INGOT:
2207+
$this->awardAchievement("acquireIron");
2208+
break;
2209+
}
22132210
}
22142211
}
22152212
}

0 commit comments

Comments
 (0)