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