本文整理汇总了Java中codechicken.nei.recipe.GuiUsageRecipe类的典型用法代码示例。如果您正苦于以下问题:Java GuiUsageRecipe类的具体用法?Java GuiUsageRecipe怎么用?Java GuiUsageRecipe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GuiUsageRecipe类属于codechicken.nei.recipe包,在下文中一共展示了GuiUsageRecipe类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: loadConfigPostInit
import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
public static void loadConfigPostInit() {
// Since two instance of the same class are regarded as one by the API of NEI,
// So we directly added them to the handlers of NEI, without using the API class.
for (PluginMachineRecipe pluginMachineRecipe: PluginMachineRecipeManager.listPluginMachineRecipe) {
GuiCraftingRecipe.craftinghandlers.add(pluginMachineRecipe);
GuiUsageRecipe.usagehandlers.add(pluginMachineRecipe);
}
}
示例5: removeUsageHandlers
import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
private static void removeUsageHandlers() {
Iterator iter = GuiUsageRecipe.usagehandlers.iterator();
while (iter.hasNext()) {
IUsageHandler usageHandler = (IUsageHandler) iter.next();
if (usageHandler instanceof PluginStackInfo || usageHandler instanceof PluginMachineRecipe)
iter.remove();
}
}
示例6: checkOrder
import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
public boolean checkOrder() {
if (this.checkedOrder) {
return false;
}
this.checkedOrder = true;
return this.changeOrder(GuiUsageRecipe.usagehandlers) | this.changeOrder(GuiCraftingRecipe.craftinghandlers);
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: dump
import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
@Override
public Iterable<String[]> dump(int mode) {
List<String[]> list = new LinkedList<String[]>();
for (ICraftingHandler crafting : GuiCraftingRecipe.craftinghandlers) {
list.add(new String[] { crafting.getClass().getName(), "crafting" });
}
for (IUsageHandler usage : GuiUsageRecipe.usagehandlers) {
list.add(new String[] { usage.getClass().getName(), "usage" });
}
return list;
}
示例11: 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;
}
示例12: loadHandler
import codechicken.nei.recipe.GuiUsageRecipe; //导入依赖的package包/类
private void loadHandler(TemplateRecipeHandler handler) {
GuiCraftingRecipe.craftinghandlers.add(handler);
GuiUsageRecipe.usagehandlers.add(handler);
}