mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-24 03:12:45 +00:00
84 lines
2.0 KiB
Java
84 lines
2.0 KiB
Java
package mineverse.Aust1n46.chat.gui;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import org.bukkit.Material;
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
|
|
import mineverse.Aust1n46.chat.MineverseChat;
|
|
|
|
public class GuiSlot {
|
|
private static MineverseChat plugin = MineverseChat.getInstance();
|
|
private static List<GuiSlot> guiSlots;
|
|
|
|
private String text;
|
|
private String command;
|
|
private String permission;
|
|
private Material icon;
|
|
private String name;
|
|
private int durability;
|
|
private int slot;
|
|
|
|
public GuiSlot(String name, String icon, int durability, String text, String permission, String command, int slot) {
|
|
this.name = name;
|
|
this.text = text;
|
|
this.command = command;
|
|
this.permission = "venturechat." + permission;
|
|
this.icon = Material.valueOf(icon.toUpperCase());
|
|
this.durability = durability;
|
|
this.slot = slot;
|
|
}
|
|
|
|
public static void initialize() {
|
|
guiSlots = new ArrayList<GuiSlot>();
|
|
ConfigurationSection cs = plugin.getConfig().getConfigurationSection("venturegui");
|
|
for (String key : cs.getKeys(false)) {
|
|
String name = key;
|
|
String icon = cs.getString(key + ".icon");
|
|
int durability = cs.getInt(key + ".durability");
|
|
String text = cs.getString(key + ".text");
|
|
String permission = cs.getString(key + ".permission");
|
|
String command = cs.getString(key + ".command");
|
|
int slot = cs.getInt(key + ".slot");
|
|
guiSlots.add(new GuiSlot(name, icon, durability, text, permission, command, slot));
|
|
}
|
|
}
|
|
|
|
public static List<GuiSlot> getGuiSlots() {
|
|
return guiSlots;
|
|
}
|
|
|
|
public String getText() {
|
|
return text;
|
|
}
|
|
|
|
public String getCommand() {
|
|
return command;
|
|
}
|
|
|
|
public String getPermission() {
|
|
return permission;
|
|
}
|
|
|
|
public Material getIcon() {
|
|
return icon;
|
|
}
|
|
|
|
public int getDurability() {
|
|
return durability;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public int getSlot() {
|
|
return slot;
|
|
}
|
|
|
|
public boolean hasPermission() {
|
|
return !permission.equalsIgnoreCase("venturechat.none");
|
|
}
|
|
}
|