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


Java GuiContainerManager.getStackMouseOver方法代码示例

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


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

示例1: keyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
public boolean keyTyped(final GuiContainer guiContainer, final char c, final int i) {
    final int keyBinding = NEIClientConfig.getKeyBinding("gui.xu_ping");
    if (i != keyBinding) {
        return false;
    }
    final LayoutManager layout = LayoutManager.instance();
    if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
        return false;
    }
    final ItemStack stackMouseOver = GuiContainerManager.getStackMouseOver(guiContainer);
    if (stackMouseOver == null || stackMouseOver.getItem() == null) {
        return false;
    }
    NetworkHandler.sendPacketToServer(new PacketNEIPing(stackMouseOver));
    return true;
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:17,代码来源:NEIPing.java

示例2: mouseClicked

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
    ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
    if (stackover == null || !(gui instanceof GuiRecipe)) {
        return false;
    }

    if (button == 0) {
        return GuiCraftingRecipe.openRecipeGui("item", stackover.copy());
    }

    if (button == 1) {
        return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
    }

    return false;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:18,代码来源:RecipeItemInputHandler.java

示例3: lastKeyTyped

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode)
{
    ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
    if(stackover == null)
        return false;
            
    if(keyCode == NEIClientConfig.getKeyBinding("gui.usage") || (keyCode == NEIClientConfig.getKeyBinding("gui.recipe") && NEIClientUtils.shiftKey()))
        return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
    
    if(keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
        return GuiCraftingRecipe.openRecipeGui("item", stackover.copy());
    
    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:RecipeItemInputHandler.java

示例4: mouseClicked

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button)
{
    ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
    if(stackover == null || !(gui instanceof GuiRecipe))
        return false;
    
    if(button == 0)
        return GuiCraftingRecipe.openRecipeGui("item", stackover.copy());

    if(button == 1)
        return GuiUsageRecipe.openRecipeGui("item", stackover.copy());
    
    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:RecipeItemInputHandler.java

示例5: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
    currenttip = super.handleTooltip(gui, currenttip, recipe);
    Point mousepos = GuiDraw.getMousePosition();
    Point relMouse = new Point(mousepos.x - gui.guiLeft, mousepos.y - gui.guiTop);
    Point recipepos = gui.getRecipePosition(recipe);
    if (currenttip.isEmpty() && GuiContainerManager.getStackMouseOver(gui) == null &&
            new Rectangle(recipepos.x, recipepos.y, 166, 55).contains(relMouse))
        currenttip.add(NEIClientUtils.translate(
                "recipe.firework.tooltip" + ((CachedFireworkRecipe) arecipes.get(recipe)).recipeType));
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:FireworkRecipeHandler.java

示例6: handleTooltip

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe) {
    currenttip = super.handleTooltip(gui, currenttip, recipe);
    Point mousepos = GuiDraw.getMousePosition();
    Point relMouse = new Point(mousepos.x - gui.guiLeft, mousepos.y - gui.guiTop);
    Point recipepos = gui.getRecipePosition(recipe);
    if (currenttip.isEmpty() && GuiContainerManager.getStackMouseOver(gui) == null && new Rectangle(recipepos.x, recipepos.y, 166, 55).contains(relMouse)) {
        currenttip.add(NEIClientUtils.translate("recipe.firework.tooltip" + ((CachedFireworkRecipe) arecipes.get(recipe)).recipeType));
    }
    return currenttip;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:12,代码来源:FireworkRecipeHandler.java


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