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


Java GuiUsageRecipe.openRecipeGui方法代码示例

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


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

示例1: mouseUp

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
@Override
public void mouseUp(int mousex, int mousey, int button) {
    ItemPanelSlot hoverSlot = getSlotMouseOver(mousex, mousey);
    if (hoverSlot != null && hoverSlot.slotIndex == mouseDownSlot && draggedStack == null) {
        ItemStack item = hoverSlot.item;
        if (NEIController.manager.window instanceof GuiRecipe || !NEIClientConfig.canCheatItem(item)) {
            if (button == 0)
                GuiCraftingRecipe.openRecipeGui("item", item);
            else if (button == 1)
                GuiUsageRecipe.openRecipeGui("item", item);

            draggedStack = null;
            mouseDownSlot = -1;
            return;
        }

        NEIClientUtils.cheatItem(item, button, -1);
    }

    mouseDownSlot = -1;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:ItemPanel.java

示例2: doGasLookup

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
public boolean doGasLookup(GasStack stack, boolean type)
{
	if(stack != null && stack.amount > 0)
	{
		if(type)
		{
			if(!GuiUsageRecipe.openRecipeGui("gas", new Object[] {stack}))
			{
				return false;
			}
		}
		else {
			if(!GuiCraftingRecipe.openRecipeGui("gas", new Object[] {stack}))
			{
				return false;
			}
		}

		return true;
	}

	return false;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:BaseRecipeHandler.java

示例3: doFluidLookup

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
public boolean doFluidLookup(FluidStack stack, boolean type)
{
	if(stack != null && stack.amount > 0)
	{
		if(type)
		{
			if(!GuiUsageRecipe.openRecipeGui("fluid", new Object[] {stack}))
			{
				return false;
			}
		}
		else {
			if(!GuiCraftingRecipe.openRecipeGui("fluid", new Object[] {stack}))
			{
				return false;
			}
		}

		return true;
	}

	return false;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:BaseRecipeHandler.java

示例4: transferFluid

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
private boolean transferFluid(GuiRecipe gui, int recipe, boolean usage)
{
    if (arecipes.get(recipe) instanceof CachedCookingPotRecipe)
    {
    	CachedCookingPotRecipe crecipe = (CachedCookingPotRecipe)arecipes.get(recipe);
    	
    	ItemStack itemFluid = null;
    	Point mousePosition = GuiDraw.getMousePosition();
        Point guiOffset = gui.getRecipePosition(recipe);
        int guiLeft = (gui.width - 158) / 2;
        int guiTop = (gui.height - 92) / 2;
        Point pointMouse = new Point(mousePosition.x - guiLeft - guiOffset.x, mousePosition.y - guiTop - guiOffset.y);
        
        if (crecipe.getInputFluidRect().contains(pointMouse) && (crecipe.getInputFluid() != null))
        	itemFluid = Helper.getItemStackForFluid(crecipe.getInputFluid());
        
        if (crecipe.getOutputFluidRect().contains(pointMouse) && (crecipe.getOutputFluid() != null)) 
        	itemFluid = Helper.getItemStackForFluid(crecipe.getOutputFluid());
        
        if (itemFluid != null)
        {
        	if(usage ? GuiUsageRecipe.openRecipeGui("item", itemFluid) : GuiCraftingRecipe.openRecipeGui("item", itemFluid))
        		return true;
        }
    }
    return false;
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:28,代码来源:CookingPotRecipeHandler.java

示例5: transfer

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
public boolean transfer(boolean usage) {
	if (this.tank != null && this.tank.amount > 0) {
		if (usage) {
			if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] { this.tank })) {
				return false;
			}
		} else {
			if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] { this.tank })) {
				return false;
			}
		}
		return true;
	}
	return false;
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:16,代码来源:PositionedFluidStack.java

示例6: transfer

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
public boolean transfer(boolean usage) {
    if (this.tank.getFluid() != null && this.tank.getFluid().amount > 0) {
        if (usage) {
            if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] { this.tank.getFluid() })) {
                return false;
            }
        } else {
            if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] { this.tank.getFluid() })) {
                return false;
            }
        }
        return true;
    }
    return false;
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:16,代码来源:PositionedFluidTank.java

示例7: transferFluid

import codechicken.nei.recipe.GuiUsageRecipe; //导入方法依赖的package包/类
private boolean transferFluid(GuiRecipe gui, int recipe, boolean usage)
{
    CachedRecipe crecipe = arecipes.get(recipe);
    if (crecipe instanceof CachedBarrelRecipe)
    {
        Point mousepos = getMousePosition();
        Point offset = gui.getRecipePosition(recipe);
        Point relMouse = new Point(mousepos.x - gui.guiLeft - offset.x, mousepos.y - gui.guiTop - offset.y);
        ItemStack fluidStack = null;
        if (recipeOutFluidRect().contains(relMouse) && (((CachedBarrelRecipe) crecipe).getOutFluid() != null)) fluidStack = Helper.getItemStacksForFluid(((CachedBarrelRecipe) crecipe).getOutFluid())[0];
        if (recipeInFluidRect().contains(relMouse) && (((CachedBarrelRecipe) crecipe).getInFluid() != null)) fluidStack = Helper.getItemStacksForFluid(((CachedBarrelRecipe) crecipe).getInFluid())[0];
        if (fluidStack != null && (usage ? GuiUsageRecipe.openRecipeGui("item", fluidStack) : GuiCraftingRecipe.openRecipeGui("item", fluidStack))) return true;
    }
    return false;
}
 
开发者ID:dries007,项目名称:TFCraft-NEIplugin,代码行数:16,代码来源:BarrelRecipeHandler.java


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