Added a getter
And a TODO
This commit is contained in:
parent
cbbb5572b8
commit
2beb6662ea
2 changed files with 3 additions and 1 deletions
|
@ -66,7 +66,7 @@ public abstract class Component {
|
||||||
val metaAnn = component.getClass().getAnnotation(ComponentMetadata.class);
|
val metaAnn = component.getClass().getAnnotation(ComponentMetadata.class);
|
||||||
if (metaAnn != null) {
|
if (metaAnn != null) {
|
||||||
Class<? extends Component>[] dependencies = metaAnn.depends();
|
Class<? extends Component>[] dependencies = metaAnn.depends();
|
||||||
for (val dep : dependencies) {
|
for (val dep : dependencies) { //TODO: Support dependencies at enable/disable as well
|
||||||
if (!components.containsKey(dep)) {
|
if (!components.containsKey(dep)) {
|
||||||
plugin.getLogger().warning("Failed to " + (register ? "" : "un") + "register component " + component.getClassName() + " as a required dependency is missing/disabled: " + dep.getSimpleName());
|
plugin.getLogger().warning("Failed to " + (register ? "" : "un") + "register component " + component.getClassName() + " as a required dependency is missing/disabled: " + dep.getSimpleName());
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package buttondevteam.lib.architecture;
|
package buttondevteam.lib.architecture;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -10,6 +11,7 @@ import java.util.function.Function;
|
||||||
*/
|
*/
|
||||||
public final class IHaveConfig {
|
public final class IHaveConfig {
|
||||||
private final HashMap<String, ConfigData<?>> datamap = new HashMap<>();
|
private final HashMap<String, ConfigData<?>> datamap = new HashMap<>();
|
||||||
|
@Getter
|
||||||
private ConfigurationSection config;
|
private ConfigurationSection config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue