use of net.frozenorb.potpvp.util.config.impl.BasicConfigurationFile in project PotPvPReprised by DevDrizzy.
the class GlobalHologram method spawn.
/**
* Spawn the hologram for all players on the server
* at the given location in the constructor
*/
public void spawn() {
Preconditions.checkNotNull(this.meta, "Hologram Meta can not be null!");
BasicConfigurationFile config = plugin.getHologramsConfig();
Hologram apiHologram = HologramsAPI.createHologram(plugin, meta.getLocation());
apiHologram.clearLines();
apiHologram.getVisibilityManager().setVisibleByDefault(true);
if (!apiHologram.getLocation().getChunk().isLoaded()) {
apiHologram.getLocation().getChunk().load();
}
for (String line : config.getStringList("SETTINGS.DEFAULT.LINES")) {
if (line.contains("<top>")) {
int position = 1;
for (Map.Entry<String, Integer> entry : plugin.getEloHandler().topElo(null).entrySet()) {
apiHologram.appendTextLine(config.getString("SETTINGS.DEFAULT.FORMAT").replace("<number>", String.valueOf(position)).replace("<value>", String.valueOf(entry.getValue())).replace("<name>", entry.getKey()));
position++;
}
continue;
}
String replace = line.replace("<update>", String.valueOf(updateIn));
apiHologram.appendTextLine(replace);
}
meta.setHologram(apiHologram);
}
use of net.frozenorb.potpvp.util.config.impl.BasicConfigurationFile in project PotPvPReprised by DevDrizzy.
the class PotPvPRP method onEnable.
@Override
public void onEnable() {
this.consoleLog("&c------------------------------------------------");
this.setupMongo();
this.uuidCache = new UUIDCache();
this.commandHandler = new CommandHandler(this);
this.commandHandler.bind(KitType.class).toProvider(new KitTypeProvider());
this.commandHandler.bind(ChatColor.class).toProvider(new ChatColorProvider());
this.commandHandler.bind(UUID.class).toProvider(new UUIDDrinkProvider());
this.registerCommands();
this.registerPermission();
ScoreboardAdapter scoreboardAdapter = new ScoreboardAdapter();
NameTagAdapter nameTagAdapter = new NameTagAdapter();
// TablistAdapter tablistAdapter = new TablistAdapter();
this.scoreboardHandler = new ScoreboardHandler(this, scoreboardAdapter);
this.scoreboardHandler.setAssembleStyle(AssembleStyle.KOHI);
this.scoreboardHandler.setTicks(2);
this.nameTagHandler = new NameTagHandler(this);
this.nameTagHandler.registerAdapter(nameTagAdapter);
if (this.getServer().getPluginManager().isPluginEnabled("HolographicDisplays")) {
this.logger("&7Found &cHolographicDisplays&7, Hooking holograms....");
hologramsConfig = new BasicConfigurationFile(this, "holograms");
this.hologramHandler = new HologramHandler(this, hologramsConfig);
this.hologramHandler.init();
}
for (World world : Bukkit.getWorlds()) {
world.setGameRuleValue("doDaylightCycle", "false");
world.setGameRuleValue("doMobSpawning", "false");
world.setTime(6_000L);
}
kitHandler = new KitHandler();
eloHandler = new EloHandler();
duelHandler = new DuelHandler();
lobbyHandler = new LobbyHandler();
arenaHandler = new ArenaHandler();
matchHandler = new MatchHandler();
partyHandler = new PartyHandler();
queueHandler = new QueueHandler();
followHandler = new FollowHandler();
rematchHandler = new RematchHandler();
settingHandler = new SettingHandler();
pvpClassHandler = new PvPClassHandler();
tournamentHandler = new TournamentHandler();
postMatchInvHandler = new PostMatchInvHandler();
this.getServer().getPluginManager().registerEvents(new BasicPreventionListener(), this);
this.getServer().getPluginManager().registerEvents(new BowHealthListener(), this);
this.getServer().getPluginManager().registerEvents(new ChatToggleListener(), this);
this.getServer().getPluginManager().registerEvents(new NightModeListener(), this);
this.getServer().getPluginManager().registerEvents(new PearlCooldownListener(), this);
this.getServer().getPluginManager().registerEvents(new TabCompleteListener(), this);
this.getServer().getPluginManager().registerEvents(new StatisticsHandler(), this);
this.getServer().getPluginManager().registerEvents(new EventListeners(), this);
this.getServer().getPluginManager().registerEvents(new TournamentListener(), this);
this.getServer().getPluginManager().registerEvents(new ButtonListener(), this);
this.logger("Registering listeners...");
this.setupHourEvents();
this.getServer().getScheduler().runTaskTimerAsynchronously(this, cache, 20L, 20L);
new Morpheus(this);
this.consoleLog("");
this.consoleLog("&7Initialized &cPotPvP &7Successfully!");
this.consoleLog("&c------------------------------------------------");
}
use of net.frozenorb.potpvp.util.config.impl.BasicConfigurationFile in project PotPvPReprised by DevDrizzy.
the class KitHologram method spawn.
/**
* Spawn the hologram for all players on the server
* at the given location in the constructor
*/
public void spawn() {
Preconditions.checkNotNull(this.meta, "Hologram Meta can not be null!");
BasicConfigurationFile config = plugin.getHologramsConfig();
Hologram apiHologram = HologramsAPI.createHologram(plugin, meta.getLocation());
apiHologram.clearLines();
apiHologram.getVisibilityManager().setVisibleByDefault(true);
if (!apiHologram.getLocation().getChunk().isLoaded()) {
apiHologram.getLocation().getChunk().load();
}
for (String line : config.getStringList("SETTINGS.KIT.LINES")) {
if (line.contains("<top>")) {
int position = 1;
for (Map.Entry<String, Integer> entry : plugin.getEloHandler().topElo(kit).entrySet()) {
apiHologram.appendTextLine(config.getString("SETTINGS.KIT.FORMAT").replace("<number>", String.valueOf(position)).replace("<value>", String.valueOf(entry.getValue())).replace("<name>", entry.getKey()));
position++;
}
continue;
}
String replace = line.replace("<kit>", kit.getDisplayName()).replace("<update>", String.valueOf(updateIn));
apiHologram.appendTextLine(replace);
}
meta.setHologram(apiHologram);
}
Aggregations