• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GuiUsageRecipe类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
public static void loadConfigPostInit() {
    // Since two instance of the same class are regarded as one by the API of NEI,
    // So we directly added them to the handlers of NEI, without using the API class.
    for (PluginMachineRecipe pluginMachineRecipe: PluginMachineRecipeManager.listPluginMachineRecipe) {
        GuiCraftingRecipe.craftinghandlers.add(pluginMachineRecipe);
        GuiUsageRecipe.usagehandlers.add(pluginMachineRecipe);
    }
}
 
开发者ID:GWYOG,项目名称:CustomNEIPlugins,代码行数:9,代码来源:NEIPluginConfig.java


示例5: removeUsageHandlers

import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的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


示例6: checkOrder

import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
public boolean checkOrder() {
    if (this.checkedOrder) {
        return false;
    }
    this.checkedOrder = true;
    return this.changeOrder(GuiUsageRecipe.usagehandlers) | this.changeOrder(GuiCraftingRecipe.craftinghandlers);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:8,代码来源:InfoHandler.java


示例7: 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


示例8: 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


示例9: 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


示例10: dump

import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的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


示例11: 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


示例12: loadHandler

import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
private void loadHandler(TemplateRecipeHandler handler) {
	GuiCraftingRecipe.craftinghandlers.add(handler);
	GuiUsageRecipe.usagehandlers.add(handler);
}
 
开发者ID:CraftedMods,项目名称:nei-lotr,代码行数:5,代码来源:NeiLotrNEIConfig.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CompleteRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java MapUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap