diff --git a/pom.xml b/pom.xml index 4ba4eda..30509c7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.artillexstudios AxTrade - 1.5.0 + 1.5.1 jar AxTrade diff --git a/src/main/java/com/artillexstudios/axtrade/trade/Trade.java b/src/main/java/com/artillexstudios/axtrade/trade/Trade.java index 88fa2bd..fc23ba1 100644 --- a/src/main/java/com/artillexstudios/axtrade/trade/Trade.java +++ b/src/main/java/com/artillexstudios/axtrade/trade/Trade.java @@ -109,7 +109,9 @@ public class Trade { List player1Items = new ArrayList<>(); player1.getTradeGui().getItems().forEach(itemStack -> { if (itemStack == null) return; - ContainerUtils.INSTANCE.addOrDrop(player2.getPlayer().getInventory(), List.of(itemStack), player2.getPlayer().getLocation()); + Scheduler.get().runAt(player2.getPlayer().getLocation(), task -> { + ContainerUtils.INSTANCE.addOrDrop(player2.getPlayer().getInventory(), List.of(itemStack), player2.getPlayer().getLocation()); + }); final String itemName = Utils.getFormattedItemName(itemStack); int itemAm = itemStack.getAmount(); player1Items.add(itemAm + "x " + itemName); @@ -120,7 +122,9 @@ public class Trade { List player2Items = new ArrayList<>(); player2.getTradeGui().getItems().forEach(itemStack -> { if (itemStack == null) return; - ContainerUtils.INSTANCE.addOrDrop(player1.getPlayer().getInventory(), List.of(itemStack), player1.getPlayer().getLocation()); + Scheduler.get().runAt(player1.getPlayer().getLocation(), task -> { + ContainerUtils.INSTANCE.addOrDrop(player1.getPlayer().getInventory(), List.of(itemStack), player1.getPlayer().getLocation()); + }); final String itemName = Utils.getFormattedItemName(itemStack); int itemAm = itemStack.getAmount(); player2Items.add(itemAm + "x " + itemName);