package cx.sfy.TheBridge.managers; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.bukkit.configuration.ConfigurationSection; import cx.sfy.TheBridge.Main; import cx.sfy.TheBridge.cosmetics.Arrow; import lombok.Getter; public class ArrowManager { Main plugin; @Getter private HashMap arrows = new HashMap(); @Getter private List unlocked = null; @Getter private List locked = null; @Getter private List noPerm = null; public ArrowManager(Main plugin) { this.plugin = plugin; loadArrows(); } public void loadArrows() { List un = new ArrayList(); for (String u : plugin.getArrow().getList("unlocked")) { un.add(u); } unlocked = un; List lo = new ArrayList(); for (String l : plugin.getArrow().getList("locked")) { lo.add(l); } locked = lo; List pe = new ArrayList(); for (String p : plugin.getArrow().getList("noPerm")) { pe.add(p); } noPerm = pe; ConfigurationSection conf = plugin.getArrow().getConfig().getConfigurationSection("arrows"); for (String arrow : conf.getKeys(false)) { arrows.put(arrow, new Arrow(plugin, "arrows." + arrow, arrow)); } } public Arrow getArrowByName(String name) { if (arrows.containsKey(name)) { return arrows.get(name); } return null; } }