Clear the player's cursor when setting inventory contents

feat/data-edit-commands
William 2 years ago
parent 2017ecc20f
commit 9dc5577175

@ -157,7 +157,9 @@ public class BukkitPlayer extends OnlineUser {
return BukkitSerializer.deserializeInventory(itemData.serializedItems).thenApplyAsync(contents -> { return BukkitSerializer.deserializeInventory(itemData.serializedItems).thenApplyAsync(contents -> {
final CompletableFuture<Void> inventorySetFuture = new CompletableFuture<>(); final CompletableFuture<Void> inventorySetFuture = new CompletableFuture<>();
Bukkit.getScheduler().runTask(BukkitHuskSync.getInstance(), () -> { Bukkit.getScheduler().runTask(BukkitHuskSync.getInstance(), () -> {
player.setItemOnCursor(null);
player.getInventory().setContents(contents.getContents()); player.getInventory().setContents(contents.getContents());
player.updateInventory();
inventorySetFuture.complete(null); inventorySetFuture.complete(null);
}); });
return inventorySetFuture.join(); return inventorySetFuture.join();

Loading…
Cancel
Save