use of com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity in project EliteMobs by MagmaGuy.
the class CustomBossCommandHandler method setLeashRadius.
public static void setLeashRadius(String customBossConfigFieldsString, CommandSender commandSender, int leashRadius) {
CustomBossesConfigFields customBossesConfigFields = CustomBossesConfigFields.getRegionalElites().get(customBossConfigFieldsString);
if (customBossesConfigFields == null) {
commandSender.sendMessage(ChatColorConverter.convert("&8[EliteMobs] &4Failed set the leash radius! Was the boss a valid regional boss?"));
return;
}
customBossesConfigFields.runtimeSetLeashRadius(leashRadius);
for (RegionalBossEntity regionalBossEntity : RegionalBossEntity.getRegionalBossEntitySet()) if (customBossesConfigFields.getFilename().equals(regionalBossEntity.getCustomBossesConfigFields().getFilename()))
regionalBossEntity.setLeashRadius(leashRadius);
}
use of com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity in project EliteMobs by MagmaGuy.
the class DebugScreen method openBossScreen.
private static void openBossScreen(Player player, String argument) {
TextComponent[] pages = new TextComponent[100];
int counter = 0;
for (EliteEntity eliteEntity : EntityTracker.getEliteMobEntities().values()) if (!(eliteEntity instanceof RegionalBossEntity))
if (eliteEntity instanceof CustomBossEntity) {
TextComponent textComponent = generateEntry((CustomBossEntity) eliteEntity, argument, player);
if (textComponent == null)
continue;
pages[counter] = textComponent;
counter++;
}
for (RegionalBossEntity regionalBossEntity : RegionalBossEntity.getRegionalBossEntities()) {
TextComponent textComponent = generateEntry(regionalBossEntity, argument, player);
if (textComponent == null)
continue;
pages[counter] = textComponent;
counter++;
}
BookMaker.generateBook(player, pages);
}
use of com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity in project EliteMobs by MagmaGuy.
the class StatsCommand method statsHandler.
public static void statsHandler(CommandSender commandSender) {
int aggressiveCount = 0;
int passiveCount = 0;
HashMap<EntityType, Integer> entitiesCounted = new HashMap<>();
for (World world : EliteMobs.validWorldList) for (LivingEntity livingEntity : world.getLivingEntities()) if (EntityTracker.isEliteMob(livingEntity)) {
aggressiveCount++;
if (!entitiesCounted.containsKey(livingEntity.getType()))
entitiesCounted.put(livingEntity.getType(), 1);
else
entitiesCounted.put(livingEntity.getType(), entitiesCounted.get(livingEntity.getType()) + 1);
} else if (EntityTracker.isSuperMob(livingEntity)) {
passiveCount++;
if (!entitiesCounted.containsKey(livingEntity.getType()))
entitiesCounted.put(livingEntity.getType(), 1);
else
entitiesCounted.put(livingEntity.getType(), entitiesCounted.get(livingEntity.getType()) + 1);
}
StringBuilder breakdownString = new StringBuilder("&2Breakdown: &a");
for (EntityType entityType : entitiesCounted.keySet()) {
breakdownString.append(entitiesCounted.get(entityType)).append(" ").append(entityType).append("&2, &a");
}
double highestThreat = 0;
String highestThreatUser = "";
double threatAverage = 0;
int highestGuildRank = 0;
String highestGuildUser = "";
double guildRankAverage = 0;
Player highestGuildRankPlayer = null;
for (Player player : Bukkit.getOnlinePlayers()) {
double currentTier = ElitePlayerInventory.playerInventories.get(player.getUniqueId()).getFullPlayerTier(true);
threatAverage += currentTier;
int currentGuildRank = GuildRank.getActiveGuildRank(player);
guildRankAverage += currentGuildRank;
if (currentTier > highestThreat) {
highestThreat = currentTier;
highestThreatUser = player.getDisplayName();
}
if (currentGuildRank > highestGuildRank) {
highestGuildRankPlayer = player;
highestGuildRank = currentGuildRank;
highestGuildUser = player.getDisplayName();
}
}
threatAverage /= Bukkit.getOnlinePlayers().size();
guildRankAverage /= Bukkit.getOnlinePlayers().size();
commandSender.sendMessage(ChatColorConverter.convert("§5§m-----------------------------------------------------"));
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] §a§lEliteMobs v. " + Bukkit.getPluginManager().getPlugin(MetadataHandler.ELITE_MOBS).getDescription().getVersion() + " stats:"));
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2There are currently §l§6" + (aggressiveCount + passiveCount) + " §f§2EliteMobs mobs entities in the world, of which &a" + aggressiveCount + " &2are Elite Mobs and &a" + passiveCount + " &2are Super Mobs."));
commandSender.sendMessage(ChatColorConverter.convert(breakdownString.toString()));
if (highestGuildRankPlayer == null)
return;
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2Highest online threat tier: &a" + highestThreatUser + " &2at total threat tier &a" + highestThreat));
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2Average threat tier: &a" + Round.twoDecimalPlaces(threatAverage)));
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2Highest adventurer's guild tier: &a" + highestGuildUser + " &2at guild rank &a" + GuildRank.getRankName(GuildRank.getGuildPrestigeRank(highestGuildRankPlayer), highestGuildRank) + " &2(&a" + highestGuildRank + "&2)"));
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2Average guild rank: &a" + Round.twoDecimalPlaces(guildRankAverage)));
commandSender.sendMessage(ChatColorConverter.convert("§5§m-----------------------------------------------------"));
commandSender.sendMessage("Tracked boss count: " + EntityTracker.getEliteMobEntities().size());
commandSender.sendMessage("Tracked NPC count: " + EntityTracker.getNpcEntities().size());
commandSender.sendMessage("Tracked visual item count: " + EntityTracker.getItemVisualEffects().size());
int loadedCounter = 0;
for (RegionalBossEntity regionalBossEntity : RegionalBossEntity.getRegionalBossEntities()) if (regionalBossEntity.isValid())
loadedCounter++;
commandSender.sendMessage(ChatColorConverter.convert("&7[EM] &2There are &c" + RegionalBossEntity.getRegionalBossEntities().size() + " &2Regional Bosses installed, of which &c" + loadedCounter + " &2are currently loaded."));
}
use of com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity in project EliteMobs by MagmaGuy.
the class CustomSummonPower method getFinalSpawnLocation.
private Location getFinalSpawnLocation(EliteEntity summoningEntity, Vector spawnLocationOffset) {
Location finalSpawnLocation;
if (summoningEntity instanceof RegionalBossEntity)
finalSpawnLocation = ((RegionalBossEntity) summoningEntity).getSpawnLocation().clone().add(spawnLocationOffset);
else if (summoningEntity == null)
finalSpawnLocation = null;
else
finalSpawnLocation = summoningEntity.getLocation().add(spawnLocationOffset);
if (summoningEntity instanceof CustomBossEntity && ((CustomBossEntity) summoningEntity).getMinidungeon() != null)
if (summoningEntity instanceof RegionalBossEntity)
return ((CustomBossEntity) summoningEntity).getMinidungeon().getRotatedFinalLocation(((RegionalBossEntity) summoningEntity).getSpawnLocation(), spawnLocationOffset);
else
return ((CustomBossEntity) summoningEntity).getMinidungeon().getRotatedFinalLocation((summoningEntity).getLocation(), spawnLocationOffset);
else
return finalSpawnLocation;
}
use of com.magmaguy.elitemobs.mobconstructor.custombosses.RegionalBossEntity in project EliteMobs by MagmaGuy.
the class Minidungeon method quantifySchematicBosses.
public void quantifySchematicBosses(boolean freshInstall) {
if (!isInstalled)
return;
if (!freshInstall) {
this.relativeBossLocations = new RelativeDungeonLocations(dungeonPackagerConfigFields.getRelativeBossLocations(), true);
this.relativeTreasureChestLocations = new RelativeDungeonLocations(dungeonPackagerConfigFields.getRelativeTreasureChestLocations(), false);
this.realDungeonLocations = new RealDungeonLocations();
}
this.teleportLocation = getRotatedFinalLocation(dungeonPackagerConfigFields.getAnchorPoint(), dungeonPackagerConfigFields.getTeleportPoint());
for (String regionalBossLocations : dungeonPackagerConfigFields.getRelativeBossLocations()) {
String bossFileName = regionalBossLocations.split(":")[0];
CustomBossesConfigFields customBossesConfigFields = CustomBossesConfig.getCustomBoss(bossFileName);
quantificationFilter(customBossesConfigFields);
RegionalBossEntity.getRegionalBossEntities(customBossesConfigFields).forEach((regionalBossEntity -> regionalBossEntity.setMinidungeon(this)));
if (customBossesConfigFields != null && customBossesConfigFields.isRegionalBoss())
regionalBossCount++;
}
}
Aggregations