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 -> {
final CompletableFuture<Void> inventorySetFuture = new CompletableFuture<>();
Bukkit.getScheduler().runTask(BukkitHuskSync.getInstance(), () -> {
player.setItemOnCursor(null);
player.getInventory().setContents(contents.getContents());
player.updateInventory();
inventorySetFuture.complete(null);
});
return inventorySetFuture.join();

Loading…
Cancel
Save