本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}