Merge pull request #917 from redbluescreen/master

Put wand to player's hotbar for Sponge
This commit is contained in:
Jesse Boyd 2018-02-11 22:02:50 +11:00 committed by GitHub
commit 504f790b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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