From f38796656cd5b7b455105ed27da0e5f8dfbd5fbd Mon Sep 17 00:00:00 2001 From: redbluescreen Date: Sun, 11 Feb 2018 12:54:46 +0200 Subject: [PATCH] Put wand to player's hotbar --- .../main/java/com/sk89q/worldedit/sponge/SpongePlayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sponge112/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java b/sponge112/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java index 6edc0edb..84b037f4 100644 --- a/sponge112/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java +++ b/sponge112/src/main/java/com/sk89q/worldedit/sponge/SpongePlayer.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.util.Location; import org.spongepowered.api.data.type.HandTypes; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.item.inventory.ItemStack; +import org.spongepowered.api.item.inventory.entity.PlayerInventory; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.format.TextColor; import org.spongepowered.api.text.format.TextColors; @@ -112,7 +113,8 @@ public class SpongePlayer extends AbstractPlayerActor { @Override public void giveItem(int type, int amt) { - this.player.getInventory().offer(ItemStack.of(SpongeWorldEdit.inst().getAdapter().resolveItem(type), amt)); + PlayerInventory inventory = (PlayerInventory) this.player.getInventory(); + inventory.getHotbar().offer(ItemStack.of(SpongeWorldEdit.inst().getAdapter().resolveItem(type), amt)); } @Override