Java源码示例:codechicken.nei.recipe.GuiUsageRecipe
示例1
@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
public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
super(aRecipeMap);
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier()));
if (!NEI_BW_Config.sIsAdded) {
FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "[email protected]" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
GuiCraftingRecipe.craftinghandlers.add(this);
GuiUsageRecipe.usagehandlers.add(this);
}
}
示例3
public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
super(aRecipeMap);
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier()));
if (!NEI_BW_Config.sIsAdded) {
FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "[email protected]" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
GuiCraftingRecipe.craftinghandlers.add(this);
GuiUsageRecipe.usagehandlers.add(this);
}
}
示例4
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;
}
示例5
@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;
}