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


Java GuiRecipe类代码示例

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


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

示例1: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
    Point mousePos = getMousePosition();
	try {
    	Class<GuiContainer> clazz = GuiContainer.class;       	
    	mousePos.x -= (Integer) clazz.getField("field_147003_i").get(gui);
    	mousePos.y -= (Integer) clazz.getField("field_147009_r").get(gui);
	}  catch (Exception ee) { ee.printStackTrace(); }

    if (mousePos.x < 23 && mousePos.x > 6 && mousePos.y < 78 && mousePos.y > 39)
    	currenttip.add(GCCoreUtil.translate("fluid.hydrogen"));
    else if (mousePos.x < 44 && mousePos.x > 27 && mousePos.y < 60 && mousePos.y > 39)
		currenttip.add(GCCoreUtil.translate("gas.carbondioxide.name"));
    
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:MethaneSynthesizerRecipeHandler.java

示例2: mouseUp

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

示例3: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 6 && xAxis <= 22 && yAxis >= 5+13 && yAxis <= 63+13)
	{
		currenttip.add(GasRegistry.getGas("sulfuricAcid").getLocalizedName());
	}
	else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).outputStack));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:ChemicalDissolutionChamberRecipeHandler.java

示例4: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11+7 && yAxis <= 69+7)
	{
		currenttip.add(LangUtils.localizeFluidStack(((CachedIORecipe)arecipes.get(recipe)).fluidInput.ingredient));
	}
	else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7)
	{
		currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.leftGas.getGas().getLocalizedName());
	}
	else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7)
	{
		currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.rightGas.getGas().getLocalizedName());
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:ElectrolyticSeparatorRecipeHandler.java

示例5: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();
	Point offset = gui.getRecipePosition(recipe);

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;

	if(xAxis >= 6-5 && xAxis <= 22-5 && yAxis >= 11-10 && yAxis <= 69-10)
	{
		currenttip.add(LangUtils.localizeFluidStack(((CachedIORecipe)arecipes.get(recipe)).pressurizedRecipe.getInput().getFluid()));
	}
	else if(xAxis >= 29-5 && xAxis <= 45-5 && yAxis >= 11-10 && yAxis <= 69-10)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).pressurizedRecipe.getInput().getGas()));
	}
	else if(xAxis >= 141-5 && xAxis <= 157-5 && yAxis >= 41-10 && yAxis <= 69-10)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).pressurizedRecipe.getOutput().getGasOutput()));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:25,代码来源:PRCRecipeHandler.java

示例6: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 26 && xAxis <= 42 && yAxis >= 14+13 && yAxis <= 72+13)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).chemicalInput.leftGas));
	}
	else if(xAxis >= 80 && xAxis <= 96 && yAxis >= 5+13 && yAxis <= 63+13)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).outputStack));
	}
	else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+13 && yAxis <= 72+13)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).chemicalInput.rightGas));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:ChemicalInfuserRecipeHandler.java

示例7: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 6 && xAxis <= 22 && yAxis >= 5+13 && yAxis <= 63+13)
	{
		currenttip.add(FluidRegistry.WATER.getLocalizedName(null));
	}
	else if(xAxis >= 27 && xAxis <= 43 && yAxis >= 14+13 && yAxis <= 72+13)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).inputStack));
	}
	else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+13 && yAxis <= 72+13)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).outputStack));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:ChemicalWasherRecipeHandler.java

示例8: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 26 && xAxis <= 42 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).inputStack));
	}
	else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).outputStack));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:SolarNeutronRecipeHandler.java

示例9: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 7 && xAxis <= 23 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeFluidStack(((CachedIORecipe) arecipes.get(recipe)).fluidInput));
	}
	else if(xAxis >= 153 && xAxis <= 169 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeFluidStack(((CachedIORecipe) arecipes.get(recipe)).fluidOutput));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:SolarEvaporationRecipeHandler.java

示例10: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

	if(xAxis >= 26 && xAxis <= 42 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).gasStack));
	}
	else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+4 && yAxis <= 72+4)
	{
		currenttip.add(LangUtils.localizeFluidStack(((CachedIORecipe)arecipes.get(recipe)).fluidStack));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:RotaryCondensentratorRecipeHandler.java

示例11: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();
	Point offset = gui.getRecipePosition(recipe);

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;

	if(xAxis >= 134-5 && xAxis <= 150-5 && yAxis >= 14-11 && yAxis <= 72-11)
	{
		currenttip.add(LangUtils.localizeGasStack(((CachedIORecipe)arecipes.get(recipe)).outputStack));
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:17,代码来源:ChemicalOxidizerRecipeHandler.java

示例12: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
	Point point = GuiDraw.getMousePosition();
	Point offset = gui.getRecipePosition(recipe);

	int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
	int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;

	if(xAxis >= 45 && xAxis <= 51 && yAxis >= 33 && yAxis <= 45)
	{
		currenttip.add(((CachedIORecipe)arecipes.get(recipe)).input.gasType.getLocalizedName());
	}

	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:17,代码来源:AdvancedMachineRecipeHandler.java

示例13: handleItemTooltip

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe)
{
    if (arecipes.get(recipe) instanceof CachedCookingPotRecipe)
    {
    	CachedCookingPotRecipe crecipe = (CachedCookingPotRecipe)arecipes.get(recipe);
        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))
        {
        	currenttip.add(crecipe.getInputFluid().getLocalizedName());
        	currenttip.add("(" + crecipe.getInputFluid().amount + "mB)");
        }
        
        if (crecipe.getOutputFluidRect().contains(pointMouse) && (crecipe.getOutputFluid() != null))
        {
        	currenttip.add(crecipe.getOutputFluid().getLocalizedName());
        	currenttip.add("(" + crecipe.getInputFluid().amount + "mB)");
        }
    }
    return currenttip;
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:27,代码来源:CookingPotRecipeHandler.java

示例14: keyTyped

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
{
    if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
    {
        if (transferFluid(gui, recipe, false))
        	return true;
    }
    else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
    {
        if (transferFluid(gui, recipe, true))
        	return true;
    }

    return super.keyTyped(gui, keyChar, keyCode, recipe);
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:17,代码来源:CookingPotRecipeHandler.java

示例15: mouseClicked

import codechicken.nei.recipe.GuiRecipe; //导入依赖的package包/类
@Override
public boolean mouseClicked(GuiRecipe gui, int button, int recipe)
{
    if (button == 0)
    {
        if (transferFluid(gui, recipe, false)) 
        	return true;
    }
    else if (button == 1)
    {
        if (transferFluid(gui, recipe, true))
        	return true;
    }

    return super.mouseClicked(gui, button, recipe);
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:17,代码来源:CookingPotRecipeHandler.java


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