Put wand to player's hotbar

This commit is contained in:
redbluescreen 2018-02-11 12:54:46 +02:00
parent e1c3404b16
commit f38796656c
No known key found for this signature in database
GPG Key ID: 6142DF71DFF59416

View File

@ -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