mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-23 10:35:22 +01:00
Added ability to change mob names.
This commit is contained in:
parent
d8e166fb94
commit
e95d7ead01
@ -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");
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user