本文整理匯總了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));
}