mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-10-05 09:57:25 +02: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()) {
|
for (EntityType value : EntityType.values()) {
|
||||||
if (value.isSpawnable() && value.isAlive() && !value.toString().contains("ARMOR")) {
|
if (value.isSpawnable() && value.isAlive() && !value.toString().contains("ARMOR")) {
|
||||||
mobFile.getConfig().addDefault("Mobs." + value.name() + ".Enabled", true);
|
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);
|
mobFile.getConfig().addDefault("Mobs." + value.name() + ".Max Stack Size", -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,16 +272,6 @@ public class UltimateStacker extends JavaPlugin {
|
|||||||
this.reloadConfig();
|
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() {
|
public boolean spawnersEnabled() {
|
||||||
if (this.getServer().getPluginManager().isPluginEnabled("EpicSpawners")) return false;
|
if (this.getServer().getPluginManager().isPluginEnabled("EpicSpawners")) return false;
|
||||||
return this.getConfig().getBoolean("Main.Stack Spawners");
|
return this.getConfig().getBoolean("Main.Stack Spawners");
|
||||||
|
@ -176,7 +176,7 @@ public class Methods {
|
|||||||
|
|
||||||
public static String compileEntityName(Entity entity, int amount) {
|
public static String compileEntityName(Entity entity, int amount) {
|
||||||
String nameFormat = UltimateStacker.getInstance().getConfig().getString("Entity.Name Format");
|
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("{TYPE}", displayName);
|
||||||
nameFormat = nameFormat.replace("{AMT}", Integer.toString(amount));
|
nameFormat = nameFormat.replace("{AMT}", Integer.toString(amount));
|
||||||
|
Loading…
Reference in New Issue
Block a user