• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IUsageHandler类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中codechicken.nei.recipe.IUsageHandler的典型用法代码示例。如果您正苦于以下问题:Java IUsageHandler类的具体用法?Java IUsageHandler怎么用?Java IUsageHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IUsageHandler类属于codechicken.nei.recipe包,在下文中一共展示了IUsageHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getUsageHandler

点赞 3

import codechicken.nei.recipe.IUsageHandler; //导入依赖的package包/类
@Override
public IUsageHandler getUsageHandler(String inputId, Object... ingredients) {
    if (!inputId.equals("item"))
        return this;
    ItemStack ingredient = (ItemStack) ingredients[0];
    for (ItemStack stack: PluginStackInfoManager.mapStackToPluginInfo.keySet()) {
        if (ItemStackUtils.areItemsEqual(stack, (ItemStack) ingredient)) {
            PluginStackInfo pluginStackInfo = new PluginStackInfo();
            ComponentPluginStackInfo componentPluginStackInfo = PluginStackInfoManager.mapStackToPluginInfo.get(stack);
            pluginStackInfo.setRecipePerPage(componentPluginStackInfo.recipePerPage);
            pluginStackInfo.setUnlocalizedRecipeName(componentPluginStackInfo.unlocalizedRecipeName);
            pluginStackInfo.setGuiTextureLocation(componentPluginStackInfo.guiTextureLocation);
            pluginStackInfo.setUnlocalizedDocuments(componentPluginStackInfo.unlocalizedDocuments);
            if (componentPluginStackInfo.isUsageRecipe) {
                pluginStackInfo.loadUsageRecipes(stack);
                return pluginStackInfo;
            }
        }
    }
    return this;
}
 

开发者ID:GWYOG,
项目名称:CustomNEIPlugins,
代码行数:22,
代码来源:PluginStackInfo.java

示例2: removeUsageHandlers

点赞 2

import codechicken.nei.recipe.IUsageHandler; //导入依赖的package包/类
private static void removeUsageHandlers() {
    Iterator iter = GuiUsageRecipe.usagehandlers.iterator();
    while (iter.hasNext()) {
        IUsageHandler usageHandler = (IUsageHandler) iter.next();
        if (usageHandler instanceof PluginStackInfo || usageHandler instanceof PluginMachineRecipe)
            iter.remove();
    }
}
 

开发者ID:GWYOG,
项目名称:CustomNEIPlugins,
代码行数:9,
代码来源:ConfigLoader.java

示例3: getUsageHandler

点赞 2

import codechicken.nei.recipe.IUsageHandler; //导入依赖的package包/类
public IUsageHandler getUsageHandler(final String inputId, final Object... ingredients) {
    if (!inputId.equals("item")) {
        return (IUsageHandler)this;
    }
    for (final Object ingredient : ingredients) {
        if (ingredient instanceof ItemStack && this.isValidItem((ItemStack)ingredient)) {
            return (IUsageHandler)new InfoHandler((ItemStack)ingredient);
        }
    }
    return (IUsageHandler)this;
}
 

开发者ID:sameer,
项目名称:ExtraUtilities,
代码行数:12,
代码来源:InfoHandler.java

示例4: dump

点赞 2

import codechicken.nei.recipe.IUsageHandler; //导入依赖的package包/类
@Override
public Iterable<String[]> dump(int mode) {
    List<String[]> list = new LinkedList<String[]>();
    
    for (ICraftingHandler crafting : GuiCraftingRecipe.craftinghandlers) {
        list.add(new String[] { crafting.getClass().getName(), "crafting" });
    }
    for (IUsageHandler usage : GuiUsageRecipe.usagehandlers) {
        list.add(new String[] { usage.getClass().getName(), "usage" });
    }
    
    return list;
}
 

开发者ID:Tonius,
项目名称:NEI-Integration,
代码行数:14,
代码来源:RecipeHandlerDumper.java

示例5: loadConfig

点赞 2

import codechicken.nei.recipe.IUsageHandler; //导入依赖的package包/类
public void loadConfig() {
    NEIPing.init();
    if (ExtraUtils.drum != null) {
        API.addSubset("Extra Common.Drums", (ItemFilter)new SubsetItemsNBT(Item.getItemFromBlock(ExtraUtils.drum)));
    }
    if (ExtraUtils.microBlocks != null) {
        API.addSubset("Extra Common.Extra Microblocks", (ItemFilter)new SubsetItemsNBT(ExtraUtils.microBlocks));
    }
    if (ExtraUtils.colorBlockDataEnabled) {
        API.addSubset("Extra Common.Colored Blocks", (ItemFilter)new SubsetBlockClass(BlockColor.class));
    }
    if (ExtraUtils.greenScreen != null) {
        API.addSubset("Extra Common.Lapis Caelestis", (ItemFilter)new SubsetItems(new Item[] { Item.getItemFromBlock((Block)ExtraUtils.greenScreen) }));
    }
    if (ExtraUtils.cobblestoneCompr != null) {
        API.addSubset("Extra Common.Compressed Blocks", (ItemFilter)new SubsetItems(new Item[] { Item.getItemFromBlock((Block)ExtraUtils.cobblestoneCompr) }));
    }
    if (ExtraUtils.decorative1Enabled || ExtraUtils.decorative2Enabled) {
        API.addSubset("Extra Common.Decorative Blocks", (ItemFilter)new SubsetBlockClass(BlockDecoration.class));
    }
    if (ExtraUtils.generator2 != null) {
        final SubsetItems s = new SubsetItems(new Item[] { Item.getItemFromBlock(ExtraUtils.generator2) });
        if (ExtraUtils.generator3 != null) {
            s.addItem(Item.getItemFromBlock(ExtraUtils.generator3));
        }
        API.addSubset("Extra Common.Higher Tier Generators", (ItemFilter)s);
    }
    for (final Matcher matcher : AdvancedNodeUpgrades.entryList) {
        if (matcher != AdvancedNodeUpgrades.nullMatcher && matcher.type == Matcher.Type.ITEM && matcher.shouldAddToNEI() && matcher.isSelectable()) {
            String localizedName = matcher.getLocalizedName();
            localizedName = localizedName.replace(".exe", "");
            localizedName = localizedName.replaceAll("\\.", "");
            API.addSubset("Extra Filtering." + localizedName, (ItemFilter)new ItemFilterWrapper(matcher));
        }
    }
    API.registerRecipeHandler((ICraftingHandler)new EnderConstructorHandler());
    API.registerUsageHandler((IUsageHandler)new EnderConstructorHandler());
    API.registerRecipeHandler((ICraftingHandler)new InfoHandler());
    API.registerUsageHandler((IUsageHandler)new InfoHandler());
    API.registerRecipeHandler((ICraftingHandler)new SoulHandler());
    API.registerUsageHandler((IUsageHandler)new SoulHandler());
    if (Loader.isModLoaded("ForgeMultipart")) {
        API.registerRecipeHandler((ICraftingHandler)new FMPMicroBlocksHandler());
        API.registerUsageHandler((IUsageHandler)new FMPMicroBlocksHandler());
        API.registerRecipeHandler((ICraftingHandler)new MicroBlocksHandler());
        API.registerUsageHandler((IUsageHandler)new MicroBlocksHandler());
        API.registerGuiOverlayHandler((Class)GuiCrafting.class, (IOverlayHandler)new FMPMicroBlocksOverlayHandler(), "microblocks");
        API.registerGuiOverlayHandler((Class)GuiInventory.class, (IOverlayHandler)new FMPMicroBlocksOverlayHandler(63, 20), "microblocks2x2");
    }
    if (ExtraUtils.colorBlockData != null) {
        API.hideItem(new ItemStack(ExtraUtils.colorBlockData));
    }
    LogHelper.info("Added NEI integration", new Object[0]);
}
 

开发者ID:sameer,
项目名称:ExtraUtilities,
代码行数:55,
代码来源:NEIInfoHandlerConfig.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)