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