mirror of
https://github.com/Artillex-Studios/AxTrade.git
synced 2025-01-22 21:41:27 +01:00
Update TradeListeners.java
Fix trade cancellation bug by adding a delay check to prevent immediate trade abort when the sender moves during trade acceptance.
This commit is contained in:
parent
993b9a01cd
commit
0ae334ea66
@ -74,6 +74,7 @@ public class TradeListeners implements Listener {
|
|||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final Trade trade = Trades.getTrade(player);
|
final Trade trade = Trades.getTrade(player);
|
||||||
if (trade == null) return;
|
if (trade == null) return;
|
||||||
|
if (System.currentTimeMillis() - trade.getPrepTime() < 1_000L) return;
|
||||||
if (event.getFrom().distanceSquared(event.getTo()) == 0) return;
|
if (event.getFrom().distanceSquared(event.getTo()) == 0) return;
|
||||||
trade.abort();
|
trade.abort();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user