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:
@@ -70,6 +70,9 @@ public class SpawnListeners implements Listener {
|
||||
if(!(event.getEntity() instanceof Illusioner))
|
||||
return;
|
||||
|
||||
if(!IllusionerManager.OPTIONS.isOverride())
|
||||
return;
|
||||
|
||||
Illusioner illusioner = (Illusioner) event.getEntity();
|
||||
EntityIllusionerWrapper internalIllusioner = NMSIllusioner.convertIllusioner(illusioner, IllusionerManager.OPTIONS.getMaxHealth(), IllusionerManager.OPTIONS.getAttackDamage(), IllusionerManager.OPTIONS.getName());
|
||||
if(internalIllusioner == null) return;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class IllusionerOptions {
|
||||
private double attackDamage;
|
||||
private Set<ItemStack> drops;
|
||||
private final GameplayOptions gameplayOptions = new GameplayOptions();
|
||||
private boolean override;
|
||||
|
||||
public IllusionerOptions() {
|
||||
reload();
|
||||
@@ -38,6 +39,7 @@ public class IllusionerOptions {
|
||||
xpBounds = new Pair<>(ConfigManager.getConfig().getInt("xp.minimum"), ConfigManager.getConfig().getInt("xp.maximum"));
|
||||
maxHealth = ConfigManager.getConfig().getDouble("max-health");
|
||||
attackDamage = ConfigManager.getConfig().getDouble("attack-damage");
|
||||
override = ConfigManager.getConfig().getBool("override");
|
||||
|
||||
spawnSounds = new HashSet<>();
|
||||
ConfigManager.getConfig().config.getConfigurationSection("sounds.spawn").getKeys(false).forEach(key -> {
|
||||
@@ -115,4 +117,8 @@ public class IllusionerOptions {
|
||||
public GameplayOptions getGameplayOptions() {
|
||||
return gameplayOptions;
|
||||
}
|
||||
|
||||
public boolean isOverride() {
|
||||
return override;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
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:
|
||||
color: BLUE # Choose from: BLUE, GREEN, PINK, PURPLE, RED, WHITE, YELLOW
|
||||
style: SOLID # Choose from: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20
|
||||
|
||||
Reference in New Issue
Block a user