Added being able to give items

This commit is contained in:
sekwah41 2018-02-01 22:15:26 +00:00
parent dd2322d5e6
commit 51db1eca53

View File

@ -1,10 +1,14 @@
package com.sekwah.advancedportals.coreconnector.container;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import com.sekwah.advancedportals.core.data.PlayerLocation;
import com.sekwah.advancedportals.core.data.PortalLocation;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.Arrays;
import java.util.UUID;
/**
@ -62,5 +66,12 @@ public class PlayerContainer {
}
public void giveItem(String material, String itemName, String... itemDescription) {}
public void giveItem(String material, String itemName, String... itemDescription) {
ItemStack regionselector = new ItemStack(Material.getMaterial(material));
ItemMeta selectorname = regionselector.getItemMeta();
selectorname.setDisplayName(itemName);
selectorname.setLore(Arrays.asList(itemDescription));
regionselector.setItemMeta(selectorname);
this.player.getInventory().addItem(regionselector);
}
}