mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-23 00:49:36 +00:00
Cleaned up code
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package com.willfp.illusioner.config.configs;
|
||||
|
||||
import com.willfp.eco.util.config.BaseConfig;
|
||||
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
|
||||
import com.willfp.eco.util.config.StaticBaseConfig;
|
||||
import com.willfp.illusioner.IllusionerPlugin;
|
||||
|
||||
public class Attacks extends BaseConfig {
|
||||
public class Attacks extends StaticBaseConfig {
|
||||
/**
|
||||
* Instantiate attacks.yml.
|
||||
*/
|
||||
public Attacks() {
|
||||
super("attacks", false, IllusionerPlugin.getInstance());
|
||||
super("attacks", IllusionerPlugin.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.willfp.illusioner.config.configs;
|
||||
|
||||
import com.willfp.eco.util.config.BaseConfig;
|
||||
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
|
||||
import com.willfp.eco.util.config.StaticBaseConfig;
|
||||
import com.willfp.illusioner.IllusionerPlugin;
|
||||
|
||||
public class Sounds extends BaseConfig {
|
||||
public class Sounds extends StaticBaseConfig {
|
||||
/**
|
||||
* Instantiate sounds.yml.
|
||||
*/
|
||||
public Sounds() {
|
||||
super("sounds", false, IllusionerPlugin.getInstance());
|
||||
super("sounds", IllusionerPlugin.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,5 +116,17 @@ public class AttackListeners implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (IllusionerManager.OPTIONS.getGameplayOptions().isIgnoreFire()) {
|
||||
if (event.getCause().equals(EntityDamageEvent.DamageCause.FIRE) || event.getCause().equals(EntityDamageEvent.DamageCause.FIRE_TICK)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (IllusionerManager.OPTIONS.getGameplayOptions().isIgnoreSuffocation()) {
|
||||
if (event.getCause().equals(EntityDamageEvent.DamageCause.SUFFOCATION)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,13 +78,8 @@ public class SpawnListeners extends PluginDependent implements Listener {
|
||||
}
|
||||
});
|
||||
|
||||
EntityIllusionerProxy illusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).spawn(
|
||||
event.getBlock().getLocation(),
|
||||
IllusionerManager.OPTIONS.getMaxHealth(),
|
||||
IllusionerManager.OPTIONS.getAttackDamage(),
|
||||
IllusionerManager.OPTIONS.getName()
|
||||
);
|
||||
illusioner.createBossbar(this.getPlugin(), IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle());
|
||||
EntityIllusionerProxy illusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).spawn(event.getBlock().getLocation());
|
||||
illusioner.createBossbar(this.getPlugin());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,17 +99,11 @@ public class SpawnListeners extends PluginDependent implements Listener {
|
||||
|
||||
Illusioner illusioner = (Illusioner) event.getEntity();
|
||||
|
||||
EntityIllusionerProxy internalIllusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).adapt(
|
||||
illusioner,
|
||||
illusioner.getLocation(),
|
||||
IllusionerManager.OPTIONS.getMaxHealth(),
|
||||
IllusionerManager.OPTIONS.getAttackDamage(),
|
||||
IllusionerManager.OPTIONS.getName()
|
||||
);
|
||||
EntityIllusionerProxy internalIllusioner = ProxyUtils.getProxy(IllusionerHelperProxy.class).adapt(illusioner);
|
||||
|
||||
if (internalIllusioner == null) {
|
||||
return;
|
||||
}
|
||||
internalIllusioner.createBossbar(this.getPlugin(), IllusionerManager.OPTIONS.getColor(), IllusionerManager.OPTIONS.getStyle());
|
||||
internalIllusioner.createBossbar(this.getPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,18 @@ public class GameplayOptions extends PluginDependent {
|
||||
@Getter
|
||||
private boolean ignoreExplosionDamage;
|
||||
|
||||
/**
|
||||
* If the illusioner is immune to fire damage.
|
||||
*/
|
||||
@Getter
|
||||
private boolean ignoreFire;
|
||||
|
||||
/**
|
||||
* If the illusioner is immune to suffocation damage.
|
||||
*/
|
||||
@Getter
|
||||
private boolean ignoreSuffocation;
|
||||
|
||||
/**
|
||||
* Gameplay options.
|
||||
* @param plugin The plugin.
|
||||
@@ -87,6 +99,8 @@ public class GameplayOptions extends PluginDependent {
|
||||
shuffle = IllusionerConfigs.ATTACKS.getBool("shuffle.enabled");
|
||||
shuffleChance = IllusionerConfigs.ATTACKS.getDouble("shuffle.chance");
|
||||
ignoreExplosionDamage = this.getPlugin().getConfigYml().getBool("ignore-explosion-damage");
|
||||
ignoreFire = this.getPlugin().getConfigYml().getBool("ignore-fire-damage");
|
||||
ignoreSuffocation = this.getPlugin().getConfigYml().getBool("ignore-suffocation-damage");
|
||||
|
||||
effectOptions.clear();
|
||||
IllusionerConfigs.ATTACKS.getConfig().getConfigurationSection("effects").getKeys(false).forEach(key -> {
|
||||
|
||||
@@ -19,6 +19,8 @@ xp:
|
||||
max-health: 600 # Hearts is this number divided by 2, eg 600 is 300 hearts
|
||||
attack-damage: 50 # This isn't an easy boss. Recommend to keep this high
|
||||
ignore-explosion-damage: true
|
||||
ignore-fire-damage: false
|
||||
ignore-suffocation-damage: true
|
||||
|
||||
spawn:
|
||||
# Configure a 3x1 tall column of blocks to summon an illusioner
|
||||
|
||||
Reference in New Issue
Block a user