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

General improvements

This commit is contained in:
Auxilor
2021-03-11 14:08:36 +00:00
parent fc7bacb21f
commit 91a2e1559c
6 changed files with 34 additions and 29 deletions

View File

@@ -1,22 +1,17 @@
package com.willfp.ecobosses.bosses;
import com.willfp.eco.internal.config.AbstractUndefinedConfig;
import com.willfp.ecobosses.EcoBossesPlugin;
import com.willfp.eco.util.internal.PluginDependent;
import com.willfp.eco.util.plugin.AbstractEcoPlugin;
import lombok.AccessLevel;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
@SuppressWarnings("unchecked")
public class EcoBoss {
public class EcoBoss extends PluginDependent {
/**
* Instance of EcoArmor.
*/
private static final EcoBossesPlugin PLUGIN = EcoBossesPlugin.getInstance();
/**
* The name of the set.
* The name of the boss.
*/
@Getter
private final String name;
@@ -32,9 +27,12 @@ public class EcoBoss {
*
* @param name The name of the set.
* @param config The set's config.
* @param plugin Instance of EcoBosses.
*/
public EcoBoss(@NotNull final String name,
@NotNull final AbstractUndefinedConfig config) {
@NotNull final AbstractUndefinedConfig config,
@NotNull final AbstractEcoPlugin plugin) {
super(plugin);
this.config = config;
this.name = name;
@@ -68,4 +66,4 @@ public class EcoBoss {
+ this.getName()
+ "}";
}
}
}

View File

@@ -61,7 +61,7 @@ public class EcoBosses {
}
for (String defaultSetName : DEFAULT_BOSSES) {
new EcoBoss(defaultSetName, new BaseBossConfig(defaultSetName));
new EcoBoss(defaultSetName, new BaseBossConfig(defaultSetName), EcoBossesPlugin.getInstance());
}
try {
@@ -69,9 +69,10 @@ public class EcoBosses {
.filter(Files::isRegularFile)
.forEach(path -> {
String name = path.getFileName().toString().replace(".yml", "");
new EcoBoss (
new EcoBoss(
name,
new CustomConfig(name, YamlConfiguration.loadConfiguration(path.toFile()))
new CustomConfig(name, YamlConfiguration.loadConfiguration(path.toFile())),
EcoBossesPlugin.getInstance()
);
});
} catch (IOException e) {

View File

@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
public class DeathListeners implements Listener {
/**
* Called when the illusioner dies.
* Called when a boss dies.
*
* @param event The event to listen for.
*/