本文整理汇总了Java中codechicken.nei.api.IConfigureNEI类的典型用法代码示例。如果您正苦于以下问题:Java IConfigureNEI类的具体用法?Java IConfigureNEI怎么用?Java IConfigureNEI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IConfigureNEI类属于codechicken.nei.api包,在下文中一共展示了IConfigureNEI类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMetadata
import codechicken.nei.api.IConfigureNEI; //导入依赖的package包/类
@Override
public ModMetadata getMetadata() {
ModMetadata meta = super.getMetadata();
meta.description = "Recipe Viewer, Inventory Manager, Item Spawner, Cheats and more.\n"+ EnumChatFormatting.WHITE+"\n";
if (plugins.size() == 0) {
meta.description += EnumChatFormatting.RED+"No installed plugins.";
} else {
meta.description += EnumChatFormatting.GREEN+"Installed plugins: ";
for (int i = 0; i < plugins.size(); i++) {
if (i > 0)
meta.description += ", ";
IConfigureNEI plugin = plugins.get(i);
meta.description += plugin.getName() + " " + plugin.getVersion();
}
meta.description += ".";
}
return meta;
}
示例2: getMetadata
import codechicken.nei.api.IConfigureNEI; //导入依赖的package包/类
@Override
public ModMetadata getMetadata() {
String s_plugins = "";
if (plugins.size() == 0) {
s_plugins += EnumChatFormatting.RED+"No installed plugins.";
} else {
s_plugins += EnumChatFormatting.GREEN+"Installed plugins: ";
for (int i = 0; i < plugins.size(); i++) {
if (i > 0)
s_plugins += ", ";
IConfigureNEI plugin = plugins.get(i);
s_plugins += plugin.getName() + " " + plugin.getVersion();
}
s_plugins += ".";
}
ModMetadata meta = super.getMetadata();
meta.description = description.replace("<plugins>", s_plugins);
return meta;
}
示例3: replaceMetadata
import codechicken.nei.api.IConfigureNEI; //导入依赖的package包/类
private static void replaceMetadata() {
StringBuilder builder = new StringBuilder("\n\n");
if (plugins.isEmpty()) {
builder.append(TextFormatting.RED).append("No installed plugins.");
} else {
builder.append(TextFormatting.GREEN).append("Installed plugins: ");
for (IConfigureNEI plugin : plugins) {
builder.append("\n");
builder.append(" ").append(TextFormatting.GREEN);
builder.append(plugin.getName()).append(", Version: ").append(plugin.getVersion());
}
}
builder.append("\n\n");
//String desc = ModDescriptionEnhancer.enhanceDesc(NotEnoughItems.metadata.description);
NotEnoughItems.metadata.description = NotEnoughItems.metadata.description.replace("<plugins>", builder.toString());
}
示例4: scrapeData
import codechicken.nei.api.IConfigureNEI; //导入依赖的package包/类
public static void scrapeData(ASMDataTable dataTable) {
ImmutableList.Builder<IConfigureNEI> plugins = ImmutableList.builder();
for (ASMDataTable.ASMData data : dataTable.getAll(NEIPlugin.class.getName())) {
try {
Class<?> pluginClass = Class.forName(data.getClassName());
if (IConfigureNEI.class.isAssignableFrom(pluginClass)) {
IConfigureNEI pluginInstance = (IConfigureNEI) pluginClass.newInstance();
plugins.add(pluginInstance);
} else {
LogHelper.error("Found class with annotation @NEIPlugin but class does not implement IConfigureNEI.. Class: " + data.getClassName());
}
} catch (Exception e) {
LogHelper.fatalError("Fatal exception occurred whilst loading a plugin! Class: %s", e, data.getClassName());
}
}
NEIInitialization.plugins = plugins.build();
}
示例5: bootNEI
import codechicken.nei.api.IConfigureNEI; //导入依赖的package包/类
/**
* Called to do first initialization of NEI's core components.
* Including default item filters, Plugin initialization. ect.
*/
public static void bootNEI() {
long start = System.nanoTime();
LogHelper.info("Loading NEI.");
NEIClientConfig.loadStates();
PotionRecipeHelper.init();
hideVanillaItems();
addBaseSubsets();
loadDefaultSubsets();
loadPotionSubsets();
loadModSubsets();
loadRegistryDumps();
API.addItemFilter(() -> item -> !ItemInfo.hiddenItems.contains(item));
API.addItemFilter(() -> item -> !JEIIntegrationManager.isBlacklisted(item));
ItemList.registerLoadCallback(ItemInfo.itemSearchNames::clear);
GuiInfo.load();
LayoutManager.load();
NEIController.load();
for (IConfigureNEI plugin : plugins) {
try {
plugin.loadConfig();
LogHelper.debug("Loaded Plugin: %s[%s]", plugin.getName(), plugin.getClass().getName());
} catch (Exception e) {
LogHelper.fatalError("Caught fatal exception from an NEI plugin! Class: ", e, plugin.getClass().getName());
}
}
replaceMetadata();
ItemSorter.loadConfig();
LogHelper.info("Finished NEI Initialization after %s ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start));
}