Added ability to change mob names.

This commit is contained in:
Brianna 2019-04-03 13:31:23 -04:00
parent d8e166fb94
commit e95d7ead01
2 changed files with 2 additions and 11 deletions

View File

@ -106,6 +106,7 @@ public class UltimateStacker extends JavaPlugin {
for (EntityType value : EntityType.values()) {
if (value.isSpawnable() && value.isAlive() && !value.toString().contains("ARMOR")) {
mobFile.getConfig().addDefault("Mobs." + value.name() + ".Enabled", true);
mobFile.getConfig().addDefault("Mobs." + value.name() + ".Display Name", Methods.formatText(value.name().toLowerCase().replace("_", " "), true));
mobFile.getConfig().addDefault("Mobs." + value.name() + ".Max Stack Size", -1);
}
}
@ -271,16 +272,6 @@ public class UltimateStacker extends JavaPlugin {
this.reloadConfig();
}
public Entity getEntityByUniqueId(UUID uniqueId) {
for (World world : Bukkit.getWorlds()) {
for (Entity entity : world.getLivingEntities()) {
if (entity.getUniqueId().equals(uniqueId))
return entity;
}
}
return null;
}
public boolean spawnersEnabled() {
if (this.getServer().getPluginManager().isPluginEnabled("EpicSpawners")) return false;
return this.getConfig().getBoolean("Main.Stack Spawners");

View File

@ -176,7 +176,7 @@ public class Methods {
public static String compileEntityName(Entity entity, int amount) {
String nameFormat = UltimateStacker.getInstance().getConfig().getString("Entity.Name Format");
String displayName = Methods.formatText(entity.getType().name().toLowerCase().replace("_", " "), true);
String displayName = Methods.formatText(UltimateStacker.getInstance().getMobFile().getConfig().getString("Mobs." + entity.getType().name() + ".Display Name"));
nameFormat = nameFormat.replace("{TYPE}", displayName);
nameFormat = nameFormat.replace("{AMT}", Integer.toString(amount));