9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 16:09:24 +00:00

Added override config option

This commit is contained in:
Auxilor
2020-12-21 12:56:16 +00:00
parent d6b9756347
commit 3032ca4407
3 changed files with 11 additions and 0 deletions

View File

@@ -70,6 +70,9 @@ public class SpawnListeners implements Listener {
if(!(event.getEntity() instanceof Illusioner)) if(!(event.getEntity() instanceof Illusioner))
return; return;
if(!IllusionerManager.OPTIONS.isOverride())
return;
Illusioner illusioner = (Illusioner) event.getEntity(); Illusioner illusioner = (Illusioner) event.getEntity();
EntityIllusionerWrapper internalIllusioner = NMSIllusioner.convertIllusioner(illusioner, IllusionerManager.OPTIONS.getMaxHealth(), IllusionerManager.OPTIONS.getAttackDamage(), IllusionerManager.OPTIONS.getName()); EntityIllusionerWrapper internalIllusioner = NMSIllusioner.convertIllusioner(illusioner, IllusionerManager.OPTIONS.getMaxHealth(), IllusionerManager.OPTIONS.getAttackDamage(), IllusionerManager.OPTIONS.getName());
if(internalIllusioner == null) return; if(internalIllusioner == null) return;

View File

@@ -26,6 +26,7 @@ public class IllusionerOptions {
private double attackDamage; private double attackDamage;
private Set<ItemStack> drops; private Set<ItemStack> drops;
private final GameplayOptions gameplayOptions = new GameplayOptions(); private final GameplayOptions gameplayOptions = new GameplayOptions();
private boolean override;
public IllusionerOptions() { public IllusionerOptions() {
reload(); reload();
@@ -38,6 +39,7 @@ public class IllusionerOptions {
xpBounds = new Pair<>(ConfigManager.getConfig().getInt("xp.minimum"), ConfigManager.getConfig().getInt("xp.maximum")); xpBounds = new Pair<>(ConfigManager.getConfig().getInt("xp.minimum"), ConfigManager.getConfig().getInt("xp.maximum"));
maxHealth = ConfigManager.getConfig().getDouble("max-health"); maxHealth = ConfigManager.getConfig().getDouble("max-health");
attackDamage = ConfigManager.getConfig().getDouble("attack-damage"); attackDamage = ConfigManager.getConfig().getDouble("attack-damage");
override = ConfigManager.getConfig().getBool("override");
spawnSounds = new HashSet<>(); spawnSounds = new HashSet<>();
ConfigManager.getConfig().config.getConfigurationSection("sounds.spawn").getKeys(false).forEach(key -> { ConfigManager.getConfig().config.getConfigurationSection("sounds.spawn").getKeys(false).forEach(key -> {
@@ -115,4 +117,8 @@ public class IllusionerOptions {
public GameplayOptions getGameplayOptions() { public GameplayOptions getGameplayOptions() {
return gameplayOptions; return gameplayOptions;
} }
public boolean isOverride() {
return override;
}
} }

View File

@@ -5,6 +5,8 @@
name: "Illusioner" # What should the display name of the Illusioner be? name: "Illusioner" # What should the display name of the Illusioner be?
override: false # Should the illusioner override all "vanilla" illusioners (adds support for /spawn but may cause issues with other custom mob plugins)
bossbar: bossbar:
color: BLUE # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW color: BLUE # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW
style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20 style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20