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


Java GuiRecipe.getRecipePosition方法代码示例

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


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

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

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

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

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

示例5: transferFluidTank

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) {
    CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
    Point mousepos = GuiDraw.getMousePosition();
    Point offset = guiRecipe.getRecipePosition(recipe);
    Point relMouse = new Point(mousepos.x - (guiRecipe.width - 176) / 2 - offset.x, mousepos.y - (guiRecipe.height - 166) / 2 - offset.y);
    
    if (crecipe.getFluidTanks() != null) {
        for (PositionedFluidTank tank : crecipe.getFluidTanks()) {
            if (tank.position.contains(relMouse)) {
                return tank.transfer(usage);
            }
        }
    }
    
    return false;
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:17,代码来源:RecipeHandlerBase.java

示例6: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe){
    //  super.handleTooltip(guiRecipe, currenttip, recipe);
    MultipleInputOutputRecipe r = (MultipleInputOutputRecipe)arecipes.get(recipe);
    if(GuiContainerManager.shouldShowTooltip(guiRecipe)) {
        Point mouse = GuiDraw.getMousePosition();
        Point offset = guiRecipe.getRecipePosition(recipe);
        Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);

        for(IGuiWidget widget : r.tooltipWidgets) {
            if(widget.getBounds().contains(relMouse)) {
                widget.addTooltip(mouse.x, mouse.y, currenttip, false);
            }
        }
        if(r.tempWidget != null) {
            if(r.tempWidget.getBounds().contains(relMouse)) {
                r.heatExchanger.setTemperature(r.tempWidget.getScales()[0]);
                r.tempWidget.addTooltip(mouse.x, mouse.y, currenttip, false);
            }
        }
    }
    return currenttip;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:24,代码来源:PneumaticCraftPlugins.java

示例7: keyTyped

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, 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)
	{
		GasStack stack = ((CachedIORecipe)arecipes.get(recipe)).outputStack;

		if(keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
		{
			if(doGasLookup(stack, false))
			{
				return true;
			}
		}
		else if(keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
		{
			if(doGasLookup(stack, true))
			{
				return true;
			}
		}
	}

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

示例8: mouseClicked

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public boolean mouseClicked(GuiRecipe gui, int button, 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)
	{
		GasStack stack = ((CachedIORecipe)arecipes.get(recipe)).outputStack;

		if(button == 0)
		{
			if(doGasLookup(stack, false))
			{
				return true;
			}
		}
		else if(button == 1)
		{
			if(doGasLookup(stack, true))
			{
				return true;
			}
		}
	}

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

示例9: transferFluid

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

示例10: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
    public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
        super.handleTooltip(guiRecipe, currenttip, recipe);
        CachedMachineRecipe crecipe = (CachedMachineRecipe) this.arecipes.get(recipe);
        if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
            Point mouse = GuiDraw.getMousePosition();
            Point offset = guiRecipe.getRecipePosition(recipe);
            Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);
            
            currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse);
        }
        return currenttip;
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:14,代码来源:TemplateNEI.java

示例11: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
    super.handleTooltip(guiRecipe, currenttip, recipe);
    CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
    if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
        Point mouse = GuiDraw.getMousePosition();
        Point offset = guiRecipe.getRecipePosition(recipe);
        Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);
        
        currenttip = this.provideTooltip(guiRecipe, currenttip, crecipe, relMouse);
    }
    return currenttip;
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:14,代码来源:RecipeHandlerBase.java

示例12: handleItemTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public List<String> handleItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List<String> currenttip, int recipe) {
    super.handleItemTooltip(guiRecipe, itemStack, currenttip, recipe);
    CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
    Point mouse = GuiDraw.getMousePosition();
    Point offset = guiRecipe.getRecipePosition(recipe);
    Point relMouse = new Point(mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y);
    
    currenttip = this.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse);
    return currenttip;
}
 
开发者ID:Tonius,项目名称:NEI-Integration,代码行数:12,代码来源:RecipeHandlerBase.java

示例13: handleItemTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe)
{
    CachedRecipe irecipe = arecipes.get(recipe);
    if (irecipe 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);
        if (recipeOutFluidRect().contains(relMouse) && (((CachedBarrelRecipe) irecipe).getOutFluid() != null)) currenttip.add(Helper.tooltipForFluid(((CachedBarrelRecipe) irecipe).getOutFluid()));
        if (recipeInFluidRect().contains(relMouse) && (((CachedBarrelRecipe) irecipe).getInFluid() != null)) currenttip.add(Helper.tooltipForFluid(((CachedBarrelRecipe) irecipe).getInFluid()));
    }
    return currenttip;
}
 
开发者ID:dries007,项目名称:TFCraft-NEIplugin,代码行数:15,代码来源:BarrelRecipeHandler.java

示例14: transferFluid

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

示例15: handleTooltip

import codechicken.nei.recipe.GuiRecipe; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
			
	CachedMissileFactoryRecipe curRecipe = (CachedMissileFactoryRecipe) arecipes.get(recipe);
	
       if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
       	
           Point offset = gui.getRecipePosition(recipe);
           Point pos = GuiDraw.getMousePosition();
           Point relMouse = new Point(pos.x - (gui.width - 176) / 2 - offset.x, pos.y - (gui.height - 166) / 2 - offset.y);
           
           Rectangle energyRect = new Rectangle(27 - 5, 26 - 11, 6, 34);
           
           if (energyRect.contains(relMouse)) {

           	currenttip.add("Cost: " + MissileUtil.getEnergyCost(curRecipe.chip.item, curRecipe.fuel.item, curRecipe.armor.item) + " RF");
               return currenttip;
           }
       }
	
	return super.handleTooltip(gui, currenttip, recipe);
}
 
开发者ID:TeamMonumental,项目名称:FissionWarfare,代码行数:23,代码来源:MissileFactoryRecipeHandler.java


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