mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-16 18:44:45 +00:00
Refactor fluids code, create PluginFluids
This commit is contained in:
1 parent
a4f7e4c583
commit
98e62aa1e3
17 files changed
+645
-556
No files matched your search
@@ -61,7 +61,8 @@ public class PluginManager {
|
||||
|
||||
public enum Module {
|
||||
|
||||
CORE(new PluginCore()),
|
||||
CORE(new PluginCore(), false),
|
||||
FLUIDS(new PluginFluids(), false),
|
||||
APICULTURE(new PluginApiculture()),
|
||||
ARBORICULTURE(new PluginArboriculture()),
|
||||
ENERGY(new PluginEnergy()),
|
||||
@@ -82,9 +83,15 @@ public class PluginManager {
|
||||
NATURA(new PluginNatura()),;
|
||||
|
||||
private final ForestryPlugin instance;
|
||||
private final boolean canBeDisabled;
|
||||
|
||||
private Module(ForestryPlugin plugin) {
|
||||
this(plugin, true);
|
||||
}
|
||||
|
||||
private Module(ForestryPlugin plugin, boolean canBeDisabled) {
|
||||
this.instance = plugin;
|
||||
this.canBeDisabled = canBeDisabled;
|
||||
}
|
||||
|
||||
public ForestryPlugin instance() {
|
||||
@@ -95,6 +102,10 @@ public class PluginManager {
|
||||
return isModuleLoaded(this);
|
||||
}
|
||||
|
||||
public boolean canBeDisabled() {
|
||||
return canBeDisabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Stage getStage() {
|
||||
@@ -128,7 +139,7 @@ public class PluginManager {
|
||||
Iterator<Module> it = toLoad.iterator();
|
||||
while (it.hasNext()) {
|
||||
Module m = it.next();
|
||||
if (m == Module.CORE)
|
||||
if (!m.canBeDisabled())
|
||||
continue;
|
||||
if (!isEnabled(config, m)) {
|
||||
it.remove();
|
||||
|
||||
Reference in new issue
Block a user