当前位置: 首页>>代码示例>>Java>>正文


Java NEIClientUtils类代码示例

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


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

示例1: loadCraftingRecipes

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result) {
	result.stackSize = 1;
	if (dummy.isCookResultAcceptable(result)) {
		Map map = FurnaceRecipes.smelting().getSmeltingList();
		Iterator it = map.keySet().iterator();

		while (it.hasNext()) {
			ItemStack itemStack = (ItemStack) it.next();
			if (NEIClientUtils.areStacksSameTypeCrafting(FurnaceRecipes.smelting().getSmeltingResult(itemStack),
					result)) {
				arecipes.add(new CachedOvenRecipe(itemStack, result));
			}
		}

	}
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:18,代码来源:HobbitOvenHandler.java

示例2: openRecipeGui

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
public static boolean openRecipeGui(String inputId, Object... ingredients) {
    Minecraft mc = NEIClientUtils.mc();
    GuiContainer prevscreen = mc.currentScreen instanceof GuiContainer ? (GuiContainer) mc.currentScreen : null;

    TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
    ArrayList<IUsageHandler> handlers = new ArrayList<IUsageHandler>();
    for (IUsageHandler usagehandler : usagehandlers) {
        profiler.start(usagehandler.getRecipeName());
        IUsageHandler handler = usagehandler.getUsageHandler(inputId, ingredients);
        if (handler.numRecipes() > 0)
            handlers.add(handler);
    }
    profiler.end();
    if (handlers.isEmpty())
        return false;

    mc.displayGuiScreen(new GuiUsageRecipe(prevscreen, handlers));
    return true;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:GuiUsageRecipe.java

示例3: openRecipeGui

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
public static boolean openRecipeGui(String outputId, Object... results) {
    Minecraft mc = NEIClientUtils.mc();
    GuiContainer prevscreen = mc.currentScreen instanceof GuiContainer ? (GuiContainer) mc.currentScreen : null;

    TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
    ArrayList<ICraftingHandler> handlers = new ArrayList<ICraftingHandler>();
    for (ICraftingHandler craftinghandler : craftinghandlers) {
        profiler.start(craftinghandler.getRecipeName());
        ICraftingHandler handler = craftinghandler.getRecipeHandler(outputId, results);
        if (handler.numRecipes() > 0)
            handlers.add(handler);
    }
    profiler.end();
    if (handlers.isEmpty())
        return false;

    mc.displayGuiScreen(new GuiCraftingRecipe(prevscreen, handlers));
    return true;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:GuiCraftingRecipe.java

示例4: dumpFile

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
public void dumpFile() {
    try {
        File file = new File(CommonUtils.getMinecraftDir(), "dumps/" + getFileName(name.replaceFirst(".+\\.", "")));
        if (!file.getParentFile().exists())
            file.getParentFile().mkdirs();
        if (!file.exists())
            file.createNewFile();

        dumpTo(file);

        NEIClientUtils.printChatMessage(dumpMessage(file));
    } catch (Exception e) {
        System.err.println("Error dumping " + renderName() + " mode: " + getMode());
        e.printStackTrace();
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:17,代码来源:DataDumper.java

示例5: getIngredient

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
public PositionedStack getIngredient()
{
    int cycle = cycleticks / 48;
    if(ingred.item.getItemDamage() == -1)
    {
        PositionedStack stack = ingred.copy();
        int maxDamage = 0;
        do
        {
            maxDamage++;
            stack.item.setItemDamage(maxDamage);
        }
        while(NEIClientUtils.isValidItem(stack.item));
        
        stack.item.setItemDamage(cycle % maxDamage);
        return stack;
    }
    return ingred;
}
 
开发者ID:scott181182,项目名称:NeoCraft,代码行数:20,代码来源:KilnSmelteryNEI.java

示例6: loadUsageRecipes

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient){
    for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
        AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(i);
        boolean[] addedRecipe = new boolean[program.getRecipeList().size()];
        for(int j = 0; j < program.getRecipeList().size(); j++) {
            if(NEIClientUtils.areStacksSameTypeCrafting(program.getRecipeList().get(j).getInput(), ingredient)) {
                arecipes.add(getShape(i, j));
                addedRecipe[j] = true;
            }
        }
        if(ingredient.getItem() == Itemss.assemblyProgram && ingredient.getItemDamage() == i) {
            for(int j = 0; j < program.getRecipeList().size(); j++)
                if(!addedRecipe[j]) arecipes.add(getShape(i, j));
        } else {
            for(ItemStack machine : getMachinesFromEnum(program.getRequiredMachines())) {
                if(NEIClientUtils.areStacksSameTypeCrafting(machine, ingredient)) {
                    for(int j = 0; j < program.getRecipeList().size(); j++)
                        if(!addedRecipe[j]) arecipes.add(getShape(i, j));
                    break;
                }
            }
        }
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:26,代码来源:NEIAssemblyControllerRecipeManager.java

示例7: lastKeyTyped

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode)
{
    ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
    if(stackover == null)
        return false;
            
    if(keyCode == NEIClientConfig.getKeyBinding("gui.usage") || (keyCode == NEIClientConfig.getKeyBinding("gui.recipe") && NEIClientUtils.shiftKey()))
        return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
    
    if(keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
        return GuiCraftingRecipe.openRecipeGui("item", stackover.copy());
    
    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:RecipeItemInputHandler.java

示例8: onUpdate

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void onUpdate() {
    if (!NEIClientUtils.shiftKey()) {
        cycleticks++;
        if (cycleticks % 20 == 0)
            for (CachedRecipe crecipe : arecipes)
                ((CachedFireworkRecipe) crecipe).cycle();
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:FireworkRecipeHandler.java

示例9: handleTooltip

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
    currenttip = super.handleTooltip(gui, currenttip, recipe);
    Point mousepos = GuiDraw.getMousePosition();
    Point relMouse = new Point(mousepos.x - gui.guiLeft, mousepos.y - gui.guiTop);
    Point recipepos = gui.getRecipePosition(recipe);
    if (currenttip.isEmpty() && GuiContainerManager.getStackMouseOver(gui) == null &&
            new Rectangle(recipepos.x, recipepos.y, 166, 55).contains(relMouse))
        currenttip.add(NEIClientUtils.translate(
                "recipe.firework.tooltip" + ((CachedFireworkRecipe) arecipes.get(recipe)).recipeType));
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:FireworkRecipeHandler.java

示例10: mouseClicked

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void mouseClicked(int mousex, int mousey, int button) {
    if (modeCount() > 1 && modeButtonSize().contains(mousex, mousey)) {
        NEIClientUtils.playClickSound();
        getTag().setIntValue((getMode() + 1) % modeCount());
    } else if (dumpButtonSize().contains(mousex, mousey)) {
        NEIClientUtils.playClickSound();
        dumpFile();
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:DataDumper.java

示例11: dumpFile

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
public void dumpFile() {
    try {
        File file = new File(CommonUtils.getMinecraftDir(), "dumps/" + getFileName(name.replaceFirst(".+\\.", "")));
        if (!file.getParentFile().exists())
            file.getParentFile().mkdirs();
        if (!file.exists())
            file.createNewFile();

        dumpTo(file);

        NEIClientUtils.printChatMessage(dumpMessage(file));
    } catch (Exception e) {
        NEIClientConfig.logger.error("Error dumping " + renderName() + " mode: " + getMode(), e);
    }
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:16,代码来源:DataDumper.java

示例12: mouseClicked

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void mouseClicked(int mousex, int mousey, int button) {
    if(getMode() == 3 && resButtonSize().contains(mousex, mousey)) {
        NEIClientUtils.playClickSound();
        getTag(name+".res").setIntValue((renderTag(name+".res").getIntValue(0) + 1) % resolutions.length);
    }
    else
        super.mouseClicked(mousex, mousey, button);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:10,代码来源:ItemPanelDumper.java

示例13: loadCraftingRecipes

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result) {

    for (IAlloyFurnaceRecipe recipe : AlloyFurnaceRegistry.getInstance().getAllRecipes())
        if (recipe instanceof AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe) {
            if (NEIClientUtils.areStacksSameTypeCrafting(recipe.getCraftingResult(null), result)) {
                arecipes.add(new AlloyRecipe((AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe) recipe));
            }
        }
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:11,代码来源:AlloyFurnaceHandler.java

示例14: loadUsageRecipes

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void loadUsageRecipes(ItemStack ingredient) {

    for (IAlloyFurnaceRecipe recipe : AlloyFurnaceRegistry.getInstance().getAllRecipes()) {
        if (recipe instanceof AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe) {
            AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe standardAlloyRecipe = (AlloyFurnaceRegistry.StandardAlloyFurnaceRecipe) recipe;
            for (ItemStack input : standardAlloyRecipe.getRequiredItems()) {
                if (NEIClientUtils.areStacksSameTypeCrafting(input, ingredient)) {
                    arecipes.add(new AlloyRecipe(standardAlloyRecipe));
                    break;
                }
            }
        }
    }
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:16,代码来源:AlloyFurnaceHandler.java

示例15: loadCraftingRecipes

import codechicken.nei.NEIClientUtils; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result){
    for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
        AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(i);
        for(int j = 0; j < program.getRecipeList().size(); j++) {
            if(NEIClientUtils.areStacksSameTypeCrafting(program.getRecipeList().get(j).getOutput(), result)) {
                arecipes.add(getShape(i, j));
                break;
            }
        }
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:13,代码来源:NEIAssemblyControllerRecipeManager.java


注:本文中的codechicken.nei.NEIClientUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。