public static void createAutoGun(final Player p) { if (CreateArenaCommand.creatingArena.get(p) == true) { p.sendMessage(Main.codSignature + "§cPlease finish creating your arena first"); return; } gunBuilder.put(p, true); p.sendMessage( Main.codSignature + "§7You entered gun creator mode. Type §f/cod guncreator§7 to abort creation"); p.sendMessage("§21. §aPut the gun item in your hand and right-click"); gunBuilderStep.put(p, 1); gamemode.put(p, p.getGameMode()); p.setGameMode(GameMode.CREATIVE); BukkitRunnable br = new BukkitRunnable() { @Override public void run() { if (gunBuilder.get(p)) { SendCoolMessages.sendOverActionBar( p, "§7You are in gun creator mode. Type §f/cod guncreator§7 to leave"); } } }; br.runTaskTimer(ThisPlugin.getPlugin(), 0L, 30L); }
public static int getCost(Perk perk) { if (ThisPlugin.getPlugin().getConfig().get("Perks.Cost." + perk) != null) return ThisPlugin.getPlugin().getConfig().getInt("Perks.Cost." + perk); return 0; }