Added being able to give items

This commit is contained in:
sekwah41 2018-02-01 22:15:26 +00:00 committed by Sekwah
parent 02ddd1ebf6
commit 984bf01c03

View File

@ -1,5 +1,6 @@
package com.sekwah.advancedportals.coreconnector.container;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.UUID;
@ -59,5 +60,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);
}
}