mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
wire up creatures config
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
package com.gmail.nossr50.config;
|
||||
|
||||
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
@ -255,7 +253,7 @@ public class MainConfig extends ConfigValidated {
|
||||
}*/
|
||||
|
||||
/* Mob Healthbar */
|
||||
if (getMobHealthbarTime() == 0) {
|
||||
if (mcMMO.getConfigManager().getConfigMobs().getCombat().getHealthBars().getDisplayTimeSeconds() == 0) {
|
||||
reason.add(MOB_HEALTHBAR + "." + DISPLAY_TIME + " cannot be 0! Set to -1 to disable or set a valid value.");
|
||||
}
|
||||
|
||||
@ -462,23 +460,6 @@ public class MainConfig extends ConfigValidated {
|
||||
return getBooleanValue(GENERAL, REFRESH_CHUNKS);
|
||||
}
|
||||
|
||||
public boolean getMobHealthbarEnabled() {
|
||||
return getBooleanValue(MOB_HEALTHBAR, ENABLED);
|
||||
}
|
||||
|
||||
/* Mob Healthbar */
|
||||
public MobHealthbarType getMobHealthbarDefault() {
|
||||
try {
|
||||
return MobHealthbarType.valueOf(getStringValue(MOB_HEALTHBAR, DISPLAY_TYPE, HEARTS).toUpperCase().trim());
|
||||
} catch (IllegalArgumentException ex) {
|
||||
return MobHealthbarType.HEARTS;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMobHealthbarTime() {
|
||||
return getIntValue(MOB_HEALTHBAR, DISPLAY_TIME);
|
||||
}
|
||||
|
||||
/* Hardcore Mode */
|
||||
public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) {
|
||||
return getBooleanValue(HARDCORE, DEATH_STAT_LOSS, ENABLED, StringUtils.getCapitalized(primarySkillType.toString()));
|
||||
|
@ -1,6 +1,16 @@
|
||||
package com.gmail.nossr50.config.hocon.mobs;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionCombat {
|
||||
|
||||
@Setting(value = "Mob-Health-Bars", comment = "Health bars appear over a mobs world model when they are damaged by a player," +
|
||||
"\nTypically this is a visually representation of their health using hearts.")
|
||||
private ConfigSectionHealthBars healthBars = new ConfigSectionHealthBars();
|
||||
|
||||
public ConfigSectionHealthBars getHealthBars() {
|
||||
return healthBars;
|
||||
}
|
||||
}
|
@ -1,6 +1,39 @@
|
||||
package com.gmail.nossr50.config.hocon.mobs;
|
||||
|
||||
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSectionHealthBars {
|
||||
|
||||
public static final boolean MOB_HEALTH_BARS_DEFAULT = true;
|
||||
public static final int DISPLAY_TIME_SECONDS_DEFAULT = 3;
|
||||
public static final String HEARTS = "HEARTS";
|
||||
public static final String displayTypesList = "\nYou can use the following MobHealthBarType values: HEARTS, BAR";
|
||||
|
||||
@Setting(value = "Enable-Health-Bars", comment = "Turn this off to disable health bars appearing above mobs when damaged." +
|
||||
"\nDefault value: "+MOB_HEALTH_BARS_DEFAULT)
|
||||
private boolean enableHealthBars = MOB_HEALTH_BARS_DEFAULT;
|
||||
|
||||
@Setting(value = "Display-Bar-Type", comment = "The type of display to use for the mobs health bar." +
|
||||
displayTypesList +
|
||||
"\nDefault value: "+HEARTS)
|
||||
private MobHealthbarType displayBarType = MobHealthbarType.HEARTS;
|
||||
|
||||
@Setting(value = "Display-Time-In-Seconds", comment = "How many seconds mob health bars should be displayed before being hidden." +
|
||||
"\nDefault value: "+DISPLAY_TIME_SECONDS_DEFAULT)
|
||||
private int displayTimeSeconds = DISPLAY_TIME_SECONDS_DEFAULT;
|
||||
|
||||
public boolean isEnableHealthBars() {
|
||||
return enableHealthBars;
|
||||
}
|
||||
|
||||
public MobHealthbarType getDisplayBarType() {
|
||||
return displayBarType;
|
||||
}
|
||||
|
||||
public int getDisplayTimeSeconds() {
|
||||
return displayTimeSeconds;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user