mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-16 23:55:23 +01:00
Added being able to give items
This commit is contained in:
parent
dd2322d5e6
commit
51db1eca53
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user