use of forestry.api.modules.IForestryModule in project Binnie by ForestryMC.
the class ModuleContainer method isModuleEnabled.
@Override
public boolean isModuleEnabled(IForestryModule module) {
ForestryModule info = module.getClass().getAnnotation(ForestryModule.class);
String comment = ForestryPluginUtil.getComment(module);
Property prop = getModulesConfig().get(CONFIG_CATEGORY, info.moduleID(), true, comment);
return prop.getBoolean();
}
use of forestry.api.modules.IForestryModule in project ForestryMC by ForestryMC.
the class ForestryModEnvWarningCallable method register.
public static void register() {
Set<IForestryModule> configDisabledModules = ModuleManager.configDisabledModules;
if (!configDisabledModules.isEmpty()) {
List<String> disabledModuleNames = new ArrayList<>();
for (IForestryModule module : configDisabledModules) {
ForestryModule info = module.getClass().getAnnotation(ForestryModule.class);
disabledModuleNames.add(info.name());
}
String disabledModulesMessage = "Modules have been disabled in the config: " + Joiner.on(", ").join(disabledModuleNames);
ForestryModEnvWarningCallable callable = new ForestryModEnvWarningCallable(disabledModulesMessage);
FMLCommonHandler.instance().registerCrashCallable(callable);
}
}
use of forestry.api.modules.IForestryModule in project ForestryMC by ForestryMC.
the class CommandModules method listModulesForSender.
private static void listModulesForSender(ICommandSender sender) {
StringBuilder pluginList = new StringBuilder();
for (IForestryModule module : ModuleManager.getLoadedModules()) {
if (pluginList.length() > 0) {
pluginList.append(", ");
}
pluginList.append(makeListEntry(module));
}
CommandHelpers.sendChatMessage(sender, pluginList.toString());
}
use of forestry.api.modules.IForestryModule in project ForestryMC by ForestryMC.
the class ForestryPluginUtil method getComment.
public static String getComment(IForestryModule module) {
ForestryModule info = module.getClass().getAnnotation(ForestryModule.class);
String comment = I18n.translateToLocal(info.unlocalizedDescription());
Set<ResourceLocation> dependencies = module.getDependencyUids();
if (!dependencies.isEmpty()) {
Iterator<ResourceLocation> iDependencies = dependencies.iterator();
StringBuilder builder = new StringBuilder(comment);
builder.append("\n");
builder.append("Dependencies: [ ");
builder.append(iDependencies.next());
while (iDependencies.hasNext()) {
ResourceLocation uid = iDependencies.next();
builder.append(", ").append(uid.toString());
}
builder.append(" ]");
comment = builder.toString();
}
return comment;
}
use of forestry.api.modules.IForestryModule in project ForestryMC by ForestryMC.
the class InternalModuleHandler method runSetup.
public void runSetup() {
stage = Stage.SETUP;
for (IForestryModule module : modules) {
Log.debug("Setup API Start: {}", module);
module.setupAPI();
Log.debug("Setup API Complete: {}", module);
}
stage = Stage.SETUP_DISABLED;
for (IForestryModule module : disabledModules) {
Log.debug("Disabled-Setup Start: {}", module);
module.disabledSetupAPI();
Log.debug("Disabled-Setup Complete: {}", module);
}
stage = Stage.REGISTER;
for (IForestryModule module : modules) {
Log.debug("Register Items and Blocks Start: {}", module);
module.registerItemsAndBlocks();
Log.debug("Register Items and Blocks Complete: {}", module);
}
}
Aggregations