You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
964 B
33 lines
964 B
package cx.sfy.TheBridge.menus;
|
|
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.inventory.Inventory;
|
|
|
|
import cx.sfy.TheBridge.Main;
|
|
import cx.sfy.TheBridge.cosmetics.Arrow;
|
|
|
|
public class ArrowMenu {
|
|
Main plugin;
|
|
|
|
public ArrowMenu(Main plugin) {
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
public void createArrowMenu(Player p) {
|
|
Inventory inv = Bukkit.getServer().createInventory(null, plugin.getArrow().getInt("size"),
|
|
plugin.getArrow().get("title"));
|
|
for (Arrow arrow : plugin.getArm().getArrows().values()) {
|
|
System.out.println(arrow == null);
|
|
if (!arrow.isBuy() && !p.hasPermission(arrow.getPermission())) {
|
|
inv.setItem(arrow.getSlot(), arrow.getPermIcon());
|
|
} else if (arrow.isBuy() && !p.hasPermission(arrow.getPermission())) {
|
|
inv.setItem(arrow.getSlot(), arrow.getBuyIcon());
|
|
} else {
|
|
inv.setItem(arrow.getSlot(), arrow.getHasIcon());
|
|
}
|
|
}
|
|
p.openInventory(inv);
|
|
}
|
|
|
|
}
|