Compare commits

..
Author SHA1 Message Date
Jason Mitchell f0e09e2b0d GUI Scaling
* Recipe GUI now scales with window size, and displays more than 2 recipes per page, depending on height.
* Hacks to implement recipes per page, based on some assumptions since the height of the handlers are not exposed and are hardcoded
* _Temporarily_ disabled the overlay buttons; they were hardcoded to expect at most 2, need to make them dynamic and actually work again.
2021-03-27 13:26:11 -07:00
Prometheus0000 5d82f0af54 Fixes some handler bugs (#73)
* Fixes some handler images
* Fixed some handlers not having the right image or being in the right section

Basically just GT/BW/GT++. I also added some spaces to look nicer, and reorganized the GT/BW/GT++ a little.
2021-03-26 17:03:06 -07:00
Jason Mitchell 4c36d0625e Reorg & restyle GuiRecipe to look a bit more like JEI
Add gregtech hax to avoid overlapping
2021-03-24 21:12:18 -07:00
Jason Mitchell 5bfcc73459 Shift everything instead of conditionally 2021-03-24 18:23:30 -07:00
Lex bc1dd44c41 shift of the bookmark border 2021-03-24 18:20:20 -07:00
Jason Mitchell d2de8af64c fixes beta3 2021-03-24 17:49:24 -07:00
Jason Mitchell af50881c6e Bugfixes 2021-03-23 23:34:05 -07:00
Jason Mitchell c971199bd1 Fix IOOBE. 2021-03-23 21:59:40 -07:00
Jason Mitchell 146e882229 Angry Boubs 2021-03-22 21:20:48 -07:00
Jason Mitchell baa0a8962b Add option to switch between JEI tab style and Creative tab style 2021-03-22 20:22:00 -07:00
Léa Gris 400f38d919 impr(tab): user creative inventory tab asset and layout
This allow proprely textured GUI without the need to update a resourcepack.
2021-03-22 19:02:42 -07:00
Jason Mitchell 07ec5f67c5 DrawableResource from JEI. Swap out tab & tab icon drawing. 2021-03-21 21:43:37 -07:00
Léa Gris 79b5da1d1a refactor: override draw with correct signature 2021-03-21 19:39:12 -07:00
Jason Mitchell aa13ba7781 Fix crash on bookmark toggle
Fixes #53
2021-03-21 09:32:03 -07:00
17 changed files with 643 additions and 249 deletions

No files matched your search

+1 -1
View File
@@ -2,4 +2,4 @@ mc_version=1.7.10
forge_version=10.13.4.1614-1.7.10
ccl_version=1.1.3.138
ccc_version=1.0.7.+
mod_version=2.1.0-GTNH-beta
mod_version=2.1.0-GTNH-beta5
+3
View File
@@ -114,6 +114,9 @@ nei.options.inventory.bookmarksEnabled.false=Hidden
nei.options.inventory.jei_style_tabs=JEI Style Tabs
nei.options.inventory.jei_style_tabs.true=Yes
nei.options.inventory.jei_style_tabs.false=No [Weirdo]
nei.options.inventory.creative_tab_style=Creative or JEI tab style
nei.options.inventory.creative_tab_style.true=Creative
nei.options.inventory.creative_tab_style.false=JEI
nei.options.inventory.widgetsenabled.true=NEI Enabled
nei.options.inventory.widgetsenabled.false=NEI Disabled
nei.options.inventory.cheatmode.0=Recipe Mode
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+3 -4
View File
@@ -150,7 +150,7 @@ public class BookmarkPanel extends ItemPanel {
@Override
public int getNextX(GuiContainer gui) {
return gui.width - prev.w - 2 - ((gui.xSize + gui.width) /2 + 2);
return gui.width - prev.w - 2 - ((gui.xSize + gui.width) /2 + 2) - 16;
}
@Override
@@ -160,7 +160,7 @@ public class BookmarkPanel extends ItemPanel {
@Override
public int getPageX(GuiContainer gui) {
return gui.guiLeft * 3 / 2 + gui.xSize + 1 - ((gui.xSize + gui.width) /2 + 2);
return gui.guiLeft * 3 / 2 + gui.xSize + 1 - ((gui.xSize + gui.width) / 2 + 2) - 16;
}
public int getHightAdjustment() {
@@ -168,8 +168,7 @@ public class BookmarkPanel extends ItemPanel {
}
public int getWidth(GuiContainer gui) {
return LayoutManager.getLeftSize(gui) - ( (gui.xSize + gui.width) / 2 + 3 );
return LayoutManager.getLeftSize(gui) - ( (gui.xSize + gui.width) / 2 + 3 ) - 16;
}
}
+2
View File
@@ -6,6 +6,7 @@ public abstract class ButtonCycled extends Button
public ButtonCycled(int num) {
icons = new Image[num];
init();
}
@Override
public Image getRenderIcon()
@@ -13,6 +14,7 @@ public abstract class ButtonCycled extends Button
return icons[index];
}
public void init() {}
public int index;
public Image[] icons;
}
+27 -8
View File
@@ -8,6 +8,8 @@ import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.IRecipeOverlayRenderer;
import codechicken.nei.api.ItemInfo;
import codechicken.nei.api.LayoutStyle;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerDrawHandler;
import codechicken.nei.guihook.IContainerInputHandler;
@@ -103,12 +105,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
public static HashMap<Integer, LayoutStyle> layoutStyles = new HashMap<>();
public static boolean ftbUtilsLoaded = false;
public static boolean itemsLoaded = false;
public static void load() {
ftbUtilsLoaded = Loader.isModLoaded("FTBU");
API.addLayoutStyle(0, new LayoutStyleMinecraft());
instance = new LayoutManager();
@@ -140,7 +139,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
return gui.width - 3;
}
public static int getLeftSize(GuiContainer gui) {
return getSideWidth(gui) - ((ftbUtilsLoaded || getGamemode() == 2) ? 18 : 0);
return getSideWidth(gui);
}
@Override
@@ -258,7 +257,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
}
@Override
public void postRenderObjects(GuiContainer gui, int mousex, int mousey) {
if (!isHidden() && isEnabled()) {
@@ -335,6 +334,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
options = new ButtonCycled(3)
{
@Override
public void init() {
this.icons[0] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 32, 0, 16, 16).build();
this.icons[1] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 48, 0, 16, 16).build();
this.icons[2] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 64, 0, 16, 16).build();
}
@Override
public boolean onButtonPress(boolean rightclick) {
if (!rightclick) {
@@ -371,9 +377,15 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
bookmarksButton = new ButtonCycled(2)
{
@Override
public void init() {
this.icons[0] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 0, 0, 16, 16).build();
this.icons[1] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 16, 0, 16, 16).build();
}
@Override
public boolean onButtonPress(boolean rightclick) {
NEIClientConfig.toggleBooleanSetting("bookmarksEnabled");
NEIClientConfig.toggleBooleanSetting("inventory.bookmarksEnabled");
return true;
}
@@ -768,11 +780,18 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
}
public static void drawIcon(int x, int y, Image image) {
changeTexture("nei:textures/nei_sprites.png");
final boolean isDrawableResource = image instanceof DrawableResource;
if (!isDrawableResource)
changeTexture("nei:textures/nei_sprites.png");
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
drawTexturedModalRect(x, y, image.x, image.y, image.width, image.height);
if(!isDrawableResource)
drawTexturedModalRect(x, y, image.x, image.y, image.width, image.height);
else
((DrawableResource)image).draw(x, y);
GL11.glDisable(GL11.GL_BLEND);
}
@@ -49,11 +49,6 @@ public class LayoutStyleMinecraft extends LayoutStyle
timeButtons[2].icon = new Image(144, 24, 12, 12);
timeButtons[3].icon = new Image(156, 24, 12, 12);
heal.icon = new Image(168, 24, 12, 12);
bookmarksButton.icons[0] = new Image(0, 36, 16, 16);
bookmarksButton.icons[1] = new Image(16, 36, 16, 16);
options.icons[0] = new Image(32, 36, 16, 16);
options.icons[1] = new Image(48, 36, 16, 16);
options.icons[2] = new Image(64, 36, 16, 16);
}
@Override
@@ -141,7 +136,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
searchField.y = gui.height - searchField.h - 2;
dropDown.x = itemPanel.x - 150;
dropDown.x = gui.guiLeft;
dropDown.h = 20;
dropDown.w = Math.min(itemPanel.prev.x - dropDown.x - 3, 100);
searchField.h = 20;
@@ -189,6 +184,7 @@ public class LayoutStyleMinecraft extends LayoutStyle
final int iconX = b.x + (b.w - icon.width) / 2;
final int iconY = b.y + (b.h - icon.height) / 2;
LayoutManager.drawIcon(iconX, iconY, icon);
}
}
+7 -1
View File
@@ -78,7 +78,7 @@ public class NEIClientConfig
tag.getTag("inventory.widgetsenabled").getBooleanValue(true);
API.addOption(new OptionToggleButton("inventory.widgetsenabled"));
tag.getTag("inventory.hidden").getBooleanValue(false);
tag.getTag("inventory.cheatmode").getIntValue(2);
tag.getTag("inventory.lockmode").setComment("For those who can't help themselves.\nSet this to a mode and you will be unable to change it ingame").getIntValue(-1);
@@ -130,6 +130,9 @@ public class NEIClientConfig
tag.getTag("inventory.jei_style_tabs").setComment("Enable/disable JEI Style Tabs").getBooleanValue(true);
API.addOption(new OptionToggleButtonBoubs("inventory.jei_style_tabs", true));
tag.getTag("inventory.creative_tab_style").setComment("Creative or JEI style tabs").getBooleanValue(false);
API.addOption(new OptionToggleButton("inventory.creative_tab_style", true));
setDefaultKeyBindings();
}
@@ -294,6 +297,9 @@ public class NEIClientConfig
public static boolean areJEIStyleTabsVisible() {
return getBooleanSetting("inventory.jei_style_tabs");
}
public static boolean useCreativeTabStyle() {
return getBooleanSetting("inventory.creative_tab_style");
}
public static boolean isEnabled() {
return enabledOverride && getBooleanSetting("inventory.widgetsenabled");
}
@@ -1,18 +1,17 @@
package codechicken.nei.config;
import codechicken.lib.render.CCRenderState;
import codechicken.nei.Image;
import codechicken.nei.LayoutManager;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
import org.lwjgl.opengl.GL11;
import java.awt.Rectangle;
import static codechicken.lib.gui.GuiDraw.changeTexture;
import static codechicken.lib.gui.GuiDraw.drawStringC;
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
public class OptionToggleButtonBoubs extends OptionButton {
private static final DrawableResource coolBoubs = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 48, 16, 22, 22).build();
private static final DrawableResource angryBoubs = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 70, 16, 22, 22).build();
public class OptionToggleButtonBoubs extends OptionButton
{
public final boolean prefixed;
public OptionToggleButtonBoubs(String name, boolean prefixed) {
@@ -32,19 +31,8 @@ public class OptionToggleButtonBoubs extends OptionButton
public void drawButton(int mx, int my) {
Rectangle b = buttonSize();
LayoutManager.drawButtonBackground(b.x, b.y, b.width, b.height, true, getButtonTex(mx, my));
if(state()) {
changeTexture("nei:textures/nei_sprites.png");
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Image image = new Image(48, 52, 24, 24);
// drawTexturedModalRect(x, y, image.x, image.y, image.width, image.height);
drawTexturedModalRect(b.x + (b.width/2) - (image.width/2), b.y, image.x, image.y, image.width, image.height);
GL11.glDisable(GL11.GL_BLEND);
}else {
drawStringC(getButtonText(), b.x, b.y, b.width, b.height, getTextColour(mx, my));
}
final Image image = state() ? coolBoubs : angryBoubs;
LayoutManager.drawIcon(b.x + (b.width/2) - (coolBoubs.getWidth()/2), b.y, image);
}
public String getButtonText() {
@@ -0,0 +1,52 @@
package codechicken.nei.drawable;
import net.minecraft.util.ResourceLocation;
public class DrawableBuilder {
private final ResourceLocation resourceLocation;
private int u;
private int v;
private int width;
private int height;
private int textureWidth = 256;
private int textureHeight = 256;
private int paddingTop = 0;
private int paddingBottom = 0;
private int paddingLeft = 0;
private int paddingRight = 0;
public DrawableBuilder(String resourceLocation, int u, int v, int width, int height) {
this.u = u;
this.v = v;
this.width = width;
this.height = height;
this.resourceLocation = new ResourceLocation(resourceLocation);
}
public DrawableBuilder setTextureSize(int width, int height) {
this.textureWidth = width;
this.textureHeight = height;
return this;
}
public DrawableBuilder addPadding(int paddingTop, int paddingBottom, int paddingLeft, int paddingRight) {
this.paddingTop = paddingTop;
this.paddingBottom = paddingBottom;
this.paddingLeft = paddingLeft;
this.paddingRight = paddingRight;
return this;
}
public DrawableBuilder trim(int trimTop, int trimBottom, int trimLeft, int trimRight) {
this.u += trimLeft;
this.v += trimTop;
this.width -= trimLeft + trimRight;
this.height -= trimTop + trimBottom;
return this;
}
public DrawableResource build() {
return new DrawableResource(resourceLocation, u, v, width, height, paddingTop, paddingBottom, paddingLeft, paddingRight, textureWidth, textureHeight);
}
}
@@ -0,0 +1,56 @@
package codechicken.nei.drawable;
import codechicken.nei.Image;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.util.ResourceLocation;
public class DrawableResource extends Image {
private final ResourceLocation resourceLocation;
private final int textureWidth;
private final int textureHeight;
private final int paddingTop;
private final int paddingBottom;
private final int paddingLeft;
private final int paddingRight;
public DrawableResource(ResourceLocation resourceLocation, int u, int v, int width, int height, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight, int textureWidth, int textureHeight) {
super(u, v, width, height);
this.resourceLocation = resourceLocation;
this.textureWidth = textureWidth;
this.textureHeight = textureHeight;
this.paddingTop = paddingTop;
this.paddingBottom = paddingBottom;
this.paddingLeft = paddingLeft;
this.paddingRight = paddingRight;
}
public int getWidth() {
return width + paddingLeft + paddingRight;
}
public int getHeight() {
return height + paddingTop + paddingBottom;
}
public void draw(int xOffset, int yOffset) {
draw(xOffset, yOffset, 0, 0, 0, 0);
}
public void draw(int xOffset, int yOffset, int maskTop, int maskBottom, int maskLeft, int maskRight) {
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
final int x = xOffset + this.paddingLeft + maskLeft;
final int y = yOffset + this.paddingTop + maskTop;
final int textureX = this.x + maskLeft;
final int textureY = this.y + maskTop;
final int width = this.width - maskRight - maskLeft;
final int height = this.height - maskBottom - maskTop;
// drawModalRectWithCustomSizedTexture
Gui.func_146110_a(x, y, textureX, textureY, width, height, textureWidth, textureHeight);
}
}
@@ -102,6 +102,8 @@ public class DefaultOverlayHandler implements IOverlayHandler
{
for(IngredientDistribution distrib : assignedIngredients)
{
if(distrib.slots.length == 0) continue;
ItemStack pstack = distrib.permutation;
int transferCap = quantity*pstack.stackSize;
int transferred = 0;
+194 -79
View File
@@ -13,6 +13,8 @@ import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.IOverlayHandler;
import codechicken.nei.api.IRecipeOverlayRenderer;
import codechicken.nei.api.TaggedInventoryArea;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.guihook.IContainerTooltipHandler;
import codechicken.nei.guihook.IGuiClientSide;
@@ -34,9 +36,41 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOverlay, IGuiClientSide, IGuiHandleMouseWheel, IContainerTooltipHandler, INEIGuiHandler
{
public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOverlay, IGuiClientSide, IGuiHandleMouseWheel, IContainerTooltipHandler, INEIGuiHandler {
// Background image calculations
private static final int BG_TOP_HEIGHT = 6;
private static final int BG_MIDDLE_HEIGHT = 154;
private static final int BG_BOTTOM_HEIGHT = 6;
private static final int BG_TOP_Y = 0;
private static final int BG_MIDDLE_Y = BG_TOP_Y + BG_TOP_HEIGHT;
private static final int BG_BOTTOM_Y = BG_MIDDLE_Y + BG_MIDDLE_HEIGHT;
// Button sizes
private static final int borderPadding = 6;
private static final int buttonWidth = 13;
private static final int buttonHeight = 12;
// Background image
final DrawableResource bgTop = new DrawableBuilder("nei:textures/gui/recipebg.png", 0, BG_TOP_Y, 176, BG_TOP_HEIGHT).build();
final DrawableResource bgMiddle = new DrawableBuilder("nei:textures/gui/recipebg.png", 0, BG_MIDDLE_Y, 176, BG_MIDDLE_HEIGHT).build();
final DrawableResource bgBottom = new DrawableBuilder("nei:textures/gui/recipebg.png", 0, BG_BOTTOM_Y, 176, BG_BOTTOM_HEIGHT).build();
public ArrayList<? extends IRecipeHandler> currenthandlers = new ArrayList<>();
private static Class gregtechHandler;
static {
try {
gregtechHandler = Class.forName("gregtech.nei.GT_NEI_DefaultHandler");
} catch (ClassNotFoundException e) {
gregtechHandler = null;
}
}
// DEPRECATED
// public GuiButton overlay1;
// public GuiButton overlay2;
// END DEPRECATED
public int page;
public int recipetype;
@@ -45,10 +79,12 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
public GuiScreen prevGui;
public GuiButton nextpage;
public GuiButton prevpage;
public GuiButton overlay1;
public GuiButton overlay2;
private GuiButton nexttype;
private GuiButton prevtype;
private final Rectangle area = new Rectangle();
private final GuiRecipeTabs recipeTabs;
private int yShift = 0;
protected GuiRecipe(GuiScreen prevgui) {
super(new ContainerRecipe());
@@ -67,25 +103,43 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
public void initGui() {
this.xSize = 176;
this.ySize = Math.min(Math.max(this.height - 68, 166), 370);
super.initGui();
currenthandlers = getCurrentRecipeHandlers(); // Probably don't comment me out
GuiButton nexttype = new GuiNEIButton(0, width / 2 - 70, (height - ySize) / 2 + 3, 13, 12, "<");
GuiButton prevtype = new GuiNEIButton(1, width / 2 + 57, (height - ySize) / 2 + 3, 13, 12, ">");
nextpage = new GuiNEIButton(2, width / 2 - 70, (height + ySize) / 2 - 18, 13, 12, "<");
prevpage = new GuiNEIButton(3, width / 2 + 57, (height + ySize) / 2 - 18, 13, 12, ">");
overlay1 = new GuiNEIButton(4, width / 2 + 65, (height - ySize) / 2 + 63, 13, 12, "?");
overlay2 = new GuiNEIButton(5, width / 2 + 65, (height - ySize) / 2 + 128, 13, 12, "?");
this.guiTop = (this.height - this.ySize) / 2 + 10;
buttonList.addAll(Arrays.asList(nexttype, prevtype, nextpage, prevpage, overlay1, overlay2));
currenthandlers = getCurrentRecipeHandlers(); // Probably don't comment me out
final int rightButtonX = guiLeft + xSize - borderPadding - buttonWidth;
final int leftButtonX = guiLeft + borderPadding;
nexttype = new GuiNEIButton(0, leftButtonX, guiTop + 3, buttonWidth, buttonHeight, "<");
prevtype = new GuiNEIButton(1, rightButtonX, guiTop + 3, buttonWidth, buttonHeight, ">");
nextpage = new GuiNEIButton(2, leftButtonX, guiTop + 17, buttonWidth, buttonHeight, "<");
prevpage = new GuiNEIButton(3, rightButtonX, guiTop + 17, buttonWidth, buttonHeight, ">");
// overlay1 = new GuiNEIButton(4, width / 2 + 65, guiTop + 63, buttonWidth, buttonHeight, "?");
// overlay2 = new GuiNEIButton(5, width / 2 + 65, guiTop + 128, buttonWidth, buttonHeight, "?");
buttonList.addAll(Arrays.asList(nexttype, prevtype, nextpage, prevpage));
if (currenthandlers.size() == 1) {
nexttype.visible = false;
prevtype.visible = false;
}
checkGregTech();
recipeTabs.initLayout();
refreshPage();
}
private void checkGregTech() {
IRecipeHandler handler = currenthandlers.get(recipetype);
if (gregtechHandler != null && gregtechHandler.isInstance(handler)) {
// Gregtech decided to shift their handler by -8 and draw over shit...
yShift = 6;
} else {
yShift = 0;
}
}
@Override
public void keyTyped(char c, int i) {
@@ -98,7 +152,8 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
return;
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int recipe = page * recipehandler.recipiesPerPage(); recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipehandler.recipiesPerPage(); recipe++)
final int recipesPerPage = getRecipesPerPage();
for (int recipe = page * recipesPerPage; recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++)
if (recipehandler.keyTyped(this, c, i, recipe))
return;
@@ -120,7 +175,8 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
protected void mouseClicked(int x, int y, int button) {
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int recipe = page * recipehandler.recipiesPerPage(); recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipehandler.recipiesPerPage(); recipe++)
final int recipesPerPage = getRecipesPerPage();
for (int recipe = page * recipesPerPage; recipe < recipehandler.numRecipes() && recipe < (page + 1) * recipesPerPage; recipe++)
if (recipehandler.mouseClicked(this, button, recipe))
return;
if (recipeTabs.mouseClicked(x, y, button))
@@ -131,6 +187,7 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
protected void actionPerformed(GuiButton guibutton) {
super.actionPerformed(guibutton);
final int recipesPerPage = getRecipesPerPage();
switch (guibutton.id) {
case 0:
prevType();
@@ -144,12 +201,12 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
case 3:
nextPage();
break;
case 4:
overlayRecipe(page * currenthandlers.get(recipetype).recipiesPerPage());
break;
case 5:
overlayRecipe(page * currenthandlers.get(recipetype).recipiesPerPage() + 1);
break;
// case 4:
// overlayRecipe(page * recipesPerPage);
// break;
// case 5:
// overlayRecipe(page * recipesPerPage + 1);
// break;
}
}
@@ -162,8 +219,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
final int recipesPerPage = getRecipesPerPage();
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++)
for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++)
currenttip = recipehandler.handleTooltip(this, currenttip, i);
recipeTabs.handleTooltip(mousex, mousey, currenttip);
return currenttip;
@@ -171,8 +229,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
public List<String> handleItemTooltip(GuiContainer gui, ItemStack stack, int mousex, int mousey, List<String> currenttip) {
final int recipesPerPage = getRecipesPerPage();
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++)
for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++)
currenttip = recipehandler.handleItemTooltip(this, stack, currenttip, i);
return currenttip;
@@ -185,45 +244,44 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
private void nextPage() {
page++;
if (page > (currenthandlers.get(recipetype).numRecipes() - 1) / currenthandlers.get(recipetype).recipiesPerPage())
page = 0;
if (page > (currenthandlers.get(recipetype).numRecipes() - 1) / getRecipesPerPage()) page = 0;
}
private void prevPage() {
page--;
if (page < 0)
page = (currenthandlers.get(recipetype).numRecipes() - 1) / currenthandlers.get(recipetype).recipiesPerPage();
if (page < 0) page = (currenthandlers.get(recipetype).numRecipes() - 1) / getRecipesPerPage();
}
private void nextType() {
recipetype++;
if (recipetype >= currenthandlers.size())
recipetype = 0;
page = 0;
recipeTabs.calcPageNumber();
setRecipePage(++recipetype);
}
private void prevType() {
recipetype--;
if (recipetype < 0)
recipetype = currenthandlers.size() - 1;
setRecipePage(--recipetype);
}
public void setRecipePage(int idx) {
recipetype = idx;
if (recipetype < 0) recipetype = currenthandlers.size() - 1;
else if (recipetype >= currenthandlers.size()) recipetype = 0;
page = 0;
recipeTabs.calcPageNumber();
checkGregTech();
}
private void overlayRecipe(int recipe) {
IRecipeOverlayRenderer renderer = currenthandlers.get(recipetype).getOverlayRenderer(firstGui, recipe);
IOverlayHandler handler = currenthandlers.get(recipetype).getOverlayHandler(firstGui, recipe);
boolean shift = NEIClientUtils.shiftKey();
if (handler != null && (renderer == null || shift)) {
mc.displayGuiScreen(firstGui);
handler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift);
} else if (renderer != null) {
mc.displayGuiScreen(firstGui);
LayoutManager.overlayRenderer = renderer;
}
}
// private void overlayRecipe(int recipe) {
// IRecipeOverlayRenderer renderer = currenthandlers.get(recipetype).getOverlayRenderer(firstGui, recipe);
// IOverlayHandler handler = currenthandlers.get(recipetype).getOverlayHandler(firstGui, recipe);
// boolean shift = NEIClientUtils.shiftKey();
//
// if (handler != null && (renderer == null || shift)) {
// mc.displayGuiScreen(firstGui);
// handler.overlayRecipe(firstGui, currenthandlers.get(recipetype), recipe, shift);
// } else if (renderer != null) {
// mc.displayGuiScreen(firstGui);
// LayoutManager.overlayRenderer = renderer;
// }
// }
public void refreshPage() {
refreshSlots();
@@ -233,33 +291,38 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
area.x = guiLeft - 2;
area.y = guiTop - 4;
final boolean avarita = handler.getClass().toString().contains("fox.spiteful.avaritia.compat.nei.");
if (avarita) {
area.width = 256;
area.height = 208;
}
calcArea(handler);
checkGregTech();
final int recipesPerPage = getRecipesPerPage();
boolean multiplepages = handler.numRecipes() > recipesPerPage;
nextpage.enabled = prevpage.enabled = multiplepages;
boolean multiplepages = handler.numRecipes() > handler.recipiesPerPage();
nextpage.visible = multiplepages;
prevpage.visible = multiplepages;
if(firstGui != null) {
overlay1.yPosition = (height - ySize) / 2 + (handler.recipiesPerPage() == 2 ? 63 : 128);
overlay1.visible = handler.hasOverlay(firstGui, firstGui.inventorySlots, page * handler.recipiesPerPage());
overlay2.visible = handler.recipiesPerPage() == 2 && page * handler.recipiesPerPage() + 1 < handler.numRecipes() &&
handler.hasOverlay(firstGui, firstGui.inventorySlots, page * handler.recipiesPerPage() + 1);
} else {
overlay1.visible = overlay2.visible = false;
}
// // TODO: Display overlay buttons here again
// if(firstGui != null) {
// overlay1.yPosition = guiTop + 17 + (recipesPerPage == 2 ? 63 : 128);
// overlay1.visible = handler.hasOverlay(firstGui, firstGui.inventorySlots, page * recipesPerPage);
// overlay2.visible = recipesPerPage == 2 && page * recipesPerPage + 1 < handler.numRecipes() && handler.hasOverlay(firstGui, firstGui.inventorySlots, page * recipesPerPage + 1);
// } else {
// overlay1.visible = overlay2.visible = false;
// }
recipeTabs.refreshPage();
}
private void calcArea(IRecipeHandler handler) {
if ( handler.getClass().toString().contains("fox.spiteful.avaritia.compat.nei.")) {
// Handle Avarita's oversized handler area
area.width = 256;
area.height = 208;
}
}
private void refreshSlots() {
slotcontainer.inventorySlots.clear();
final int recipesPerPage = getRecipesPerPage();
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) {
Point p = getRecipePosition(i);
List<PositionedStack> stacks = recipehandler.getIngredientStacks(i);
@@ -279,16 +342,16 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
GuiContainerManager.enable2DRender();
final int recipesPerPage = getRecipesPerPage();
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
String s = recipehandler.getRecipeName();
fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0x404040);
s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipehandler.recipiesPerPage() + 1);
fontRendererObj.drawString(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, ySize - 16, 0x404040);
fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 5, 0xffffff);
s = NEIClientUtils.translate("recipe.page", page + 1, (currenthandlers.get(recipetype).numRecipes() - 1) / recipesPerPage + 1);
fontRendererObj.drawStringWithShadow(s, (xSize - fontRendererObj.getStringWidth(s)) / 2, 19, 0xffffff);
GL11.glPushMatrix();
GL11.glTranslatef(5, 16, 0);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
GL11.glTranslatef(5, 32 + yShift, 0);
for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) {
recipehandler.drawForeground(i);
GL11.glTranslatef(0, 65, 0);
}
@@ -297,12 +360,24 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
final int recipesPerPage = getRecipesPerPage();
GL11.glColor4f(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
final int j = (width - xSize) / 2;
final int k = guiTop;
drawBackgroundTiled(j, k);
drawRect(guiLeft + borderPadding + buttonWidth - 1,
nexttype.yPosition,
guiLeft + xSize - borderPadding - buttonWidth,
nexttype.yPosition + buttonHeight,
0x30000000);
drawRect(guiLeft + borderPadding + buttonWidth - 1,
nextpage.yPosition,
guiLeft + xSize - borderPadding - buttonWidth,
nextpage.yPosition + buttonHeight,
0x30000000);
if (NEIClientConfig.areJEIStyleTabsVisible()) {
RenderHelper.enableGUIStandardItemLighting();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
@@ -311,15 +386,40 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
}
GL11.glPushMatrix();
GL11.glTranslatef(j + 5, k + 16, 0);
GL11.glTranslatef(j + 5, k + 32 + yShift, 0);
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
for (int i = page * recipesPerPage; i < recipehandler.numRecipes() && i < (page + 1) * recipesPerPage; i++) {
recipehandler.drawBackground(i);
GL11.glTranslatef(0, 65, 0);
}
GL11.glPopMatrix();
}
private void drawBackgroundTiled(int j, int k) {
// Draw the top
bgTop.draw(j, k + BG_TOP_Y);
// Maybe Tile the middle
final int tiledHeight = ySize - BG_TOP_HEIGHT - BG_BOTTOM_HEIGHT;
if (tiledHeight > 0) {
final int yTileCount = tiledHeight / BG_MIDDLE_HEIGHT;
final int yRemainder = tiledHeight - (yTileCount * BG_MIDDLE_HEIGHT);
final int yStart = k + BG_TOP_HEIGHT + tiledHeight;
for (int yTile = 0; yTile <= yTileCount; yTile++) {
final int tileHeight = (yTile == yTileCount) ? yRemainder : BG_MIDDLE_HEIGHT;
final int y = yStart - ((yTile + 1) * BG_MIDDLE_HEIGHT);
if (tileHeight > 0) {
bgMiddle.draw(j, y, BG_MIDDLE_HEIGHT - tileHeight, 0, 0, 0);
}
}
}
// Draw the bottom
bgBottom.draw(j, k + ySize - BG_BOTTOM_HEIGHT);
}
@Override
public GuiContainer getFirstScreen() {
return firstGui;
@@ -332,9 +432,24 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
return stackSlot == mouseoverSlot;
}
private int getRecipesPerPage() {
// The handlers give no indication of height, and use hard coded values
// The default handlers have a height of 65. Go with the (most likely incorrect) assumption
// that if a handler allows more than one recipe per page the height is 65 so use that to calculate the # per page.
// If it only allows for 1 then it's unknown and we'll stick with 1 recipe per page.
final IRecipeHandler handler = currenthandlers.get(recipetype);
final int handlerRecipesPerPage = handler.recipiesPerPage();
if (handler instanceof TemplateRecipeHandler && handlerRecipesPerPage > 1) {
return ((ySize - (prevtype.height*3)) / 65);
} else {
return handlerRecipesPerPage;
}
}
public Point getRecipePosition(int recipe) {
return new Point(5, 16 + (recipe % currenthandlers.get(recipetype).recipiesPerPage()) * 65);
return new Point(5, 32 + yShift + (recipe % getRecipesPerPage()) * 65);
}
@Override
+147 -107
View File
@@ -2,9 +2,10 @@ package codechicken.nei.recipe;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.Button;
import codechicken.nei.Image;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.Widget;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -18,29 +19,37 @@ import org.lwjgl.opengl.GL11;
import java.util.HashMap;
import java.util.List;
public class GuiRecipeTab extends Button {
public static HashMap<String, ImmutablePair<String, Image>> iconMap = new HashMap<>();
public abstract class GuiRecipeTab extends Widget {
public static HashMap<String, ImmutablePair<String, DrawableResource>> imageMap = new HashMap<>();
public static HashMap<String, ImmutablePair<String, ItemStack>> stackMap = new HashMap<>();
public static final int TAB_WIDTH = 24;
public static final int TAB_HEIGHT = 24;
private static final Image selectedIcon = new Image(0, 52, 24, 24);
private static final Image unselectedIcon = new Image(24, 52, 24, 24);
private final GuiRecipe guiRecipe;
private final IRecipeHandler handler;
private final String handlerName;
private final String handlerID;
private boolean selected;
public abstract int getWidth();
public abstract int getHeight();
public abstract DrawableResource getSelectedTabImage();
public abstract DrawableResource getUnselectedTabImage();
protected abstract int getForegroundIconX();
protected abstract int getForegroundIconY();
public GuiRecipeTab(GuiRecipe guiRecipe, IRecipeHandler handler, int x, int y) {
super();
this.x = x;
this.y = y;
this.w = TAB_WIDTH;
this.h = TAB_HEIGHT;
this.w = getWidth();
this.h = getHeight();
this.handler = handler;
this.handlerName = handler.toString().split("@")[0];
this.guiRecipe = guiRecipe;
this.selected = false;
if(handler instanceof TemplateRecipeHandler) {
handlerID = (((TemplateRecipeHandler)handler).getOverlayIdentifier());
@@ -48,37 +57,37 @@ public class GuiRecipeTab extends Button {
handlerID = null;
}
}
public void draw(boolean selected, int mouseX, int mouseY) {
drawTab(selected, mouseX, mouseY);
drawTabIcon(selected, mouseX, mouseY);
@Override
public void draw(int mouseX, int mouseY) {
drawBackground(mouseX, mouseY);
drawForeground(mouseX, mouseY);
}
public void drawTab(boolean selected, int mouseX, int mouseY) {
public void drawBackground(int mouseX, int mouseY) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor4f(1, 1, 1, 1);
if (selected) icon = selectedIcon;
else icon = unselectedIcon;
final int iconX = x + (w - icon.width) / 2;
final int iconY = y + (h - icon.height) / 2;
LayoutManager.drawIcon(iconX, iconY, icon);
final DrawableResource image;
if (selected) image = getSelectedTabImage();
else image = getUnselectedTabImage();
final int iconX = x + (w - image.getWidth()) / 2;
final int iconY = y + (h - image.getHeight()) / 2;
image.draw(iconX, iconY);
}
public void drawTabIcon(boolean selected, int mouseX, int mouseY) {
final int iconX = x + 4;
final int iconY = y + 4;
public void drawForeground(int mouseX, int mouseY) {
final int iconX = getForegroundIconX();
final int iconY = getForegroundIconY();
final FontRenderer fontRenderer = GuiDraw.fontRenderer;
final Image icon = getIcon(handlerName);
final DrawableResource icon = getImage(handlerName);
final ItemStack itemStack = getItemStack(handlerName, handlerID);
if (icon != null) {
LayoutManager.drawIcon(iconX + 1, iconY + 1, icon);
icon.draw(iconX + 1, iconY + 1);
} else if (itemStack != null) {
GuiContainerManager.drawItems.zLevel += 100;
GuiContainerManager.drawItem(iconX, iconY, itemStack);
@@ -86,15 +95,14 @@ public class GuiRecipeTab extends Button {
} else {
// Text fallback
String text = handler.getRecipeName().substring(0, 2);
int textCenterX = x + (int) (TAB_WIDTH / 2f);
int textCenterY = y + (int) (TAB_HEIGHT / 2f) - 3;
int color = selected ? 16777120 : 14737632;
int textCenterX = x + (int) (getWidth() / 2f);
int textCenterY = y + (int) (getHeight() / 2f) - 3;
int color = selected ? 0xffffa0 : 0xe0e0e0;
fontRenderer.drawStringWithShadow(text, textCenterX - (int) (fontRenderer.getStringWidth(text) / 2f), textCenterY, color);
GL11.glColor4f(1, 1, 1, 1);
}
}
@Override
public void addTooltips(List<String> tooltip) {
tooltip.add(handler.getRecipeName().trim());
@@ -109,18 +117,17 @@ public class GuiRecipeTab extends Button {
}
@Override
public boolean onButtonPress(boolean rightclick) {
int newIdx = guiRecipe.currenthandlers.indexOf(handler);
if (newIdx == -1)
return false;
guiRecipe.recipetype = newIdx;
guiRecipe.setRecipePage(newIdx);
return true;
}
public boolean isSelected(IRecipeHandler current) {
return handler == current;
public void setSelected(IRecipeHandler current) {
selected = handler == current;
}
public static Pair<String, ItemStack> lookupStackMap(String name, String name2) {
@@ -136,7 +143,7 @@ public class GuiRecipeTab extends Button {
if (stackRes != null)
return stackRes.getLeft();
Pair<String, Image> iconRes = iconMap.get(name);
Pair<String, DrawableResource> iconRes = imageMap.get(name);
if (iconRes != null)
return iconRes.getLeft();
@@ -150,8 +157,8 @@ public class GuiRecipeTab extends Button {
return null;
}
public static Image getIcon(String id) {
Pair<String, Image> res = iconMap.get(id);
public static DrawableResource getImage(String id) {
Pair<String, DrawableResource> res = imageMap.get(id);
if (res != null)
return res.getRight();
return null;
@@ -165,8 +172,9 @@ public class GuiRecipeTab extends Button {
addToStackMap("codechicken.nei.recipe.FurnaceRecipeHandler", "minecraft", "minecraft:furnace");
addToStackMap("codechicken.nei.recipe.ShapedRecipeHandler", "minecraft", "minecraft:crafting_table");
addToStackMap("codechicken.nei.recipe.ShapelessRecipeHandler", "minecraft", "minecraft:crafting_table");
addToIconMap("codechicken.nei.recipe.FuelRecipeHandler", "minecraft", new Image(80, 36, 14, 14));
addToIconMap("codechicken.nei.recipe.FuelRecipeHandler", "minecraft",
new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 80, 0, 14, 14).build());
// IC2
if (Loader.isModLoaded("IC2")) {
addToStackMap("ic2.neiIntegration.core.recipehandler.AdvRecipeHandler", "IC2", "IC2:blockreactorvessel");
@@ -186,10 +194,13 @@ public class GuiRecipeTab extends Button {
addToStackMap("ic2.neiIntegration.core.recipehandler.ScrapboxRecipeHandler", "IC2", "IC2:itemScrapbox");
addToStackMap("ic2.neiIntegration.core.recipehandler.SolidCannerRecipeHandler", "IC2", "IC2:blockMachine2:9");
}
if (Loader.isModLoaded("Ic2Nei")) {
addToStackMap("speiger.src.crops.prediction.NEIPlugin", "IC2CropsNEI", "IC2:blockCrop");
}
// Gregtech 5u
if (!Loader.isModLoaded("gregapi_post") && Loader.isModLoaded("gregtech")) {
addToStackMap("gt.recipe.alloyblastsmelter", "gregtech", "gregtech:gt.blockmachines:810"); // gt.blockmachines.industrialsalloyamelter.controller.tier.single
addToStackMap("gt.recipe.alloysmelter", "gregtech", "gregtech:gt.blockmachines:201"); // gt.blockmachines.basicmachine.alloysmelter.tier.01
addToStackMap("gt.recipe.arcfurnace", "gregtech", "gregtech:gt.blockmachines:651"); // gt.blockmachines.basicmachine.arcfurnace.tier.01
addToStackMap("gt.recipe.assembler", "gregtech", "gregtech:gt.blockmachines:211"); // gt.blockmachines.basicmachine.assembler.tier.01
@@ -198,36 +209,28 @@ public class GuiRecipeTab extends Button {
addToStackMap("gt.recipe.brewer", "gregtech", "gregtech:gt.blockmachines:491"); // gt.blockmachines.basicmachine.brewery.tier.01
addToStackMap("gt.recipe.canner", "gregtech", "gregtech:gt.blockmachines:231"); // gt.blockmachines.basicmachine.canner.tier.01
addToStackMap("gt.recipe.centrifuge", "gregtech", "gregtech:gt.blockmachines:361"); // gt.blockmachines.basicmachine.centrifuge.tier.01
addToStackMap("gt.recipe.chemicalbath", "gregtech", "gregtech:gt.blockmachines:541"); // gt.blockmachines.basicmachine.chemicalbath.tier.01
addToStackMap("gt.recipe.chemicaldehydrator", "gregtech", "gregtech:gt.blockmachines:912"); // gt.blockmachines.machine.dehydrator.tier.01
addToStackMap("gt.recipe.chemicalbath", "gregtech", "gregtech:gt.blockmachines:541"); // gt.blockmachines.basicmachine.chemicalbath.tier.01
addToStackMap("gt.recipe.chemicalreactor", "gregtech", "gregtech:gt.blockmachines:421"); // gt.blockmachines.basicmachine.chemicalreactor.tier.01
addToStackMap("gt.recipe.circuitassembler", "gregtech", "gregtech:gt.blockmachines:1180"); // gt.blockmachines.basicmachine.circuitassembler.tier.01
addToStackMap("gt.recipe.cokeoven", "gregtech", "gregtech:gt.blockmachines:791"); // gt.blockmachines.industrialcokeoven.controller.tier.single
addToStackMap("gt.recipe.compressor", "gregtech", "gregtech:gt.blockmachines:241"); // gt.blockmachines.basicmachine.compressor.tier.01
addToStackMap("gt.recipe.craker", "gregtech", "gregtech:gt.blockmachines:1160"); // gt.blockmachines.multimachine.cracker
addToStackMap("gt.recipe.cuttingsaw", "gregtech", "gregtech:gt.blockmachines:251"); // gt.blockmachines.basicmachine.cutter.tier.01
addToStackMap("gt.recipe.cyclotron", "gregtech", "gregtech:gt.blockmachines:828"); // gt.blockmachines.cyclotron.tier.single
addToStackMap("gt.recipe.dieselgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:793"); // gt.blockmachines.advancedgenerator.rocketfuel.tier.01
addToStackMap("gt.recipe.cuttingsaw", "gregtech", "gregtech:gt.blockmachines:251"); // gt.blockmachines.basicmachine.cutter.tier.01
addToStackMap("gt.recipe.distillationtower", "gregtech", "gregtech:gt.blockmachines:1126"); // gt.blockmachines.multimachine.distillationtower
addToStackMap("gt.recipe.distillery", "gregtech", "gregtech:gt.blockmachines:531"); // gt.blockmachines.basicmachine.distillery.tier.01
addToStackMap("gt.recipe.electricimplosioncompressor", "gregtech", "gregtech:gt.blockmachines:12734"); // gt.blockmachines.electricimplosioncompressor
addToStackMap("gt.recipe.electrolyzer", "gregtech", "gregtech:gt.blockmachines:371"); // gt.blockmachines.basicmachine.electrolyzer.tier.01
addToStackMap("gt.recipe.electromagneticseparator", "gregtech", "gregtech:gt.blockmachines:561"); // gt.blockmachines.basicmachine.electromagneticseparator.tier.01
addToStackMap("gt.recipe.extractor", "gregtech", "gregtech:gt.blockmachines:271"); // gt.blockmachines.basicmachine.extractor.tier.01
addToStackMap("gt.recipe.extruder", "gregtech", "gregtech:gt.blockmachines:281"); // gt.blockmachines.basicmachine.extruder.tier.01
addToStackMap("gt.recipe.fakeAssemblylineProcess", "gregtech", "gregtech:gt.blockmachines:1170"); // gt.blockmachines.multimachine.assemblyline
addToStackMap("gt.recipe.fermenter", "gregtech", "gregtech:gt.blockmachines:501"); // gt.blockmachines.basicmachine.fermenter.tier.01
addToStackMap("gt.recipe.fishpond", "gregtech", "gregtech:gt.blockmachines:829"); // gt.blockmachines.industrial.fishpond.controller.tier.single
addToStackMap("gt.recipe.fermenter", "gregtech", "gregtech:gt.blockmachines:501"); // gt.blockmachines.basicmachine.fermenter.tier.01
addToStackMap("gt.recipe.fluidcanner", "gregtech", "gregtech:gt.blockmachines:431"); // gt.blockmachines.basicmachine.fluidcanner.tier.01
addToStackMap("gt.recipe.fluidextractor", "gregtech", "gregtech:gt.blockmachines:511"); // gt.blockmachines.basicmachine.fluidextractor.tier.01
addToStackMap("gt.recipe.fluidheater", "gregtech", "gregtech:gt.blockmachines:621"); // gt.blockmachines.basicmachine.fluidheater.tier.01
addToStackMap("gt.recipe.fluidsolidifier", "gregtech", "gregtech:gt.blockmachines:521"); // gt.blockmachines.basicmachine.fluidsolidifier.tier.01
addToStackMap("gt.recipe.fusionreactor", "gregtech", "gregtech:gt.blockmachines:1193"); // gt.blockmachines.fusioncomputer.tier.06
addToStackMap("gt.recipe.gasturbinefuel", "gregtech", "gregtech:gt.blockmachines:961"); // gt.blockmachines.basicgenerator.gas.tier.00
addToStackMap("gt.recipe.geothermalfuel", "gregtech", "gregtech:gt.blockmachines:830"); // gt.blockmachines.advancedgenerator.geothermalfuel.tier.01
addToStackMap("gt.recipe.fusionreactor", "gregtech", "gregtech:gt.blockmachines:1193"); // gt.blockmachines.fusioncomputer.tier.06
addToStackMap("gt.recipe.hammer", "gregtech", "gregtech:gt.blockmachines:611"); // gt.blockmachines.basicmachine.hammer.tier.01
addToStackMap("gt.recipe.implosioncompressor", "gregtech", "gregtech:gt.blockmachines:12734"); // gt.blockmachines.electricimplosioncompressor
addToStackMap("gt.recipe.largeboilerfakefuels", "gregtech", "gregtech:gt.blockmachines:1020"); // gt.blockmachines.multimachine.boiler.bronze
addToStackMap("gt.recipe.implosioncompressor", "gregtech", "gregtech:gt.blockmachines:12734"); // gt.blockmachines.electricimplosioncompressor
addToStackMap("gt.recipe.largechemicalreactor", "gregtech", "gregtech:gt.blockmachines:1169"); // gt.blockmachines.multimachine.chemicalreactor
addToStackMap("gt.recipe.laserengraver", "gregtech", "gregtech:gt.blockmachines:591"); // gt.blockmachines.basicmachine.laserengraver.tier.01
addToStackMap("gt.recipe.lathe", "gregtech", "gregtech:gt.blockmachines:291"); // gt.blockmachines.basicmachine.lathe.tier.01
@@ -239,8 +242,7 @@ public class GuiRecipeTab extends Button {
addToStackMap("gt.recipe.mixer", "gregtech", "gregtech:gt.blockmachines:581"); // gt.blockmachines.basicmachine.mixer.tier.01
addToStackMap("gt.recipe.orewasher", "gregtech", "gregtech:gt.blockmachines:391"); // gt.blockmachines.basicmachine.orewasher.tier.01
addToStackMap("gt.recipe.packager", "gregtech", "gregtech:gt.blockmachines:401"); // gt.blockmachines.basicmachine.boxinator.tier.01
addToStackMap("gt.recipe.plasmaarcfurnace", "gregtech", "gregtech:gt.blockmachines:661"); // gt.blockmachines.basicmachine.plasmaarcfurnace.tier.01
addToStackMap("gt.recipe.plasmageneratorfuels", "gregtech", "gregtech:gt.blockmachines:1196"); // gt.blockmachines.basicgenerator.plasmagenerator.tier.05
addToStackMap("gt.recipe.plasmaarcfurnace", "gregtech", "gregtech:gt.blockmachines:661"); // gt.blockmachines.basicmachine.plasmaarcfurnace.tier.01
addToStackMap("gt.recipe.polarizer", "gregtech", "gregtech:gt.blockmachines:551"); // gt.blockmachines.basicmachine.polarizer.tier.01
addToStackMap("gt.recipe.press", "gregtech", "gregtech:gt.blockmachines:601"); // gt.blockmachines.basicmachine.press.tier.01
addToStackMap("gt.recipe.primitiveblastfurnace", "gregtech", "gregtech:gt.blockmachines:140"); // gt.blockmachines.multimachine.brickedblastfurnace
@@ -248,45 +250,60 @@ public class GuiRecipeTab extends Button {
addToStackMap("gt.recipe.pyro", "gregtech", "gregtech:gt.blockmachines:1159"); // gt.blockmachines.multimachine.pyro
addToStackMap("gt.recipe.replicator", "gregtech", "gregtech:gt.blockmachines:481"); // gt.blockmachines.basicmachine.replicator.tier.01
addToStackMap("gt.recipe.rockbreaker", "gregtech", "gregtech:gt.blockmachines:441"); // gt.blockmachines.basicmachine.rockbreaker.tier.01
addToStackMap("gt.recipe.scanner", "gregtech", "gregtech:gt.blockmachines:341"); // gt.blockmachines.basicmachine.scanner.tier.01
addToStackMap("gt.recipe.semifluidboilerfuels", "gregtech", "gregtech:gt.blockmachines:837"); // gt.blockmachines.basicgenerator.semifluid.tier.01
addToStackMap("gt.recipe.semifluidgeneratorfuels", "gregtech", "gregtech:gt.blockmachines:837"); // gt.blockmachines.basicgenerator.semifluid.tier.01
addToStackMap("gt.recipe.scanner", "gregtech", "gregtech:gt.blockmachines:341"); // gt.blockmachines.basicmachine.scanner.tier.01
addToStackMap("gt.recipe.sifter", "gregtech", "gregtech:gt.blockmachines:641"); // gt.blockmachines.basicmachine.sifter.tier.01
addToStackMap("gt.recipe.slicer", "gregtech", "gregtech:gt.blockmachines:631"); // gt.blockmachines.basicmachine.slicer.tier.01
addToStackMap("gt.recipe.slowfusionreactor", "gregtech", "gregtech:gt.blockmachines:31015"); // gt.blockmachines.gtplusplus.fusion.single
addToStackMap("gt.recipe.smallnaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1188"); // gt.blockmachines.basicgenerator.naquadah.tier.07
addToStackMap("gt.recipe.slicer", "gregtech", "gregtech:gt.blockmachines:631"); // gt.blockmachines.basicmachine.slicer.tier.01
addToStackMap("gt.recipe.thermalcentrifuge", "gregtech", "gregtech:gt.blockmachines:381"); // gt.blockmachines.basicmachine.thermalcentrifuge.tier.01
addToStackMap("gt.recipe.thermalgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:830"); // gt.blockmachines.advancedgenerator.geothermalfuel.tier.01
addToStackMap("gt.recipe.unpackager", "gregtech", "gregtech:gt.blockmachines:411"); // gt.blockmachines.basicmachine.unboxinator.tier.01
addToStackMap("gt.recipe.vacuumfreezer", "gregtech", "gregtech:gt.blockmachines:1002"); // gt.blockmachines.multimachine.vacuumfreezer
addToStackMap("gt.recipe.wiremill", "gregtech", "gregtech:gt.blockmachines:351"); // gt.blockmachines.basicmachine.wiremill.tier.01
addToStackMap("ic.recipe.recycler", "gregtech", "gregtech:gt.blockmachines:331"); // gt.blockmachines.basicmachine.recycler.tier.01
// // Maybe acid generator
// //tabItemIcon.put("null", stackDB("gt.blockmachines.acidgeneratormv"));
//
// // Maybe not release
// tabItemIcon.put("gt.recipe.largenaquadahreactor", stackDB("gt.blockmachines.1nr.controller.single"));
// tabItemIcon.put("gt.recipe.fluidnaquadahreactor", stackDB("gt.blockmachines.1nr.controller.single"));
// tabItemIcon.put("gt.recipe.hugenaquadahreactor", stackDB("gt.blockmachines.1nr.controller.single"));
// tabItemIcon.put("gt.recipe.extrahugenaquadahreactor", stackDB("gt.blockmachines.1nr.controller.single"));
addToStackMap("gt.recipe.uuamplifier", "gregtech", "gregtech:gt.blockmachines:471"); // Amplifabricator
addToStackMap("gt.recipe.byproductlist", "gregtech", "gregtech:gt.metaitem.01:2019"); // Byproducts from ore processing
addToStackMap("gt.recipe.dieselgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:1110"); // LV Combustion gen
addToStackMap("gt.recipe.extremedieselgeneratorfuel", "gregtech", "gregtech:gt.blockmachines:2105"); // ECE, HOG-only
addToStackMap("gt.recipe.gasturbinefuel", "gregtech", "gregtech:gt.blockmachines:1115"); // LV gas turbine
addToStackMap("gt.recipe.largeboilerfakefuels", "gregtech", "gregtech:gt.blockmachines:1020"); // gt.blockmachines.multimachine.boiler.bronze
addToStackMap("gt.recipe.plasmageneratorfuels", "gregtech", "gregtech:gt.blockmachines:1196"); // gt.blockmachines.basicgenerator.plasmagenerator.tier.05
addToStackMap("gt.recipe.semifluidboilerfuels", "gregtech", "gregtech:gt.blockmachines:1020"); // Bronze boiler
addToStackMap("gt.recipe.smallnaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1190"); // Naq Reactor Mark I
addToStackMap("gt.recipe.largenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1191"); // Naq Reactor Mark II
addToStackMap("gt.recipe.fluidnaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1192"); // Naq Reactor Mark III. Misnamed in code
addToStackMap("gt.recipe.hugenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1188"); // Naq Reactor Mark IV. Slightly different name for recipe map
addToStackMap("gt.recipe.extrahugenaquadahreactor", "gregtech", "gregtech:gt.blockmachines:1189"); // Naq Reactor Mark V. Slightly different name for recipe map
//Fluid naq shares name with what should be huge, so it doesn't show up I guess. Also disabled.
addToStackMap("gt.recipe.componentassembler", "gregtech", "gregtech:gt.blockmachines:211"); // GT++'s incomplete compound fabricator?
addToStackMap("gt.recipe.cncmachine", "gregtech", "gregtech:gt.metaitem.01:23305"); // Disabled CNC machine?
addToStackMap("gt.recipe.thermalgeneratorfuel", "gregtech", "IC2:blockGenerator:1"); // Disabled 'Thermal Generator'? Or compat for the IC2 geothermal?
}
if (Loader.isModLoaded("appliedenergistics2")) {
addToStackMap("appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler", "AppliedEnergistics2","appliedenergistics2:item.ItemMultiPart:380");
addToStackMap("appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler","AppliedEnergistics2", "appliedenergistics2:item.ItemMultiPart:380");
addToStackMap("appeng.integration.modules.NEIHelpers.NEIFacadeRecipeHandler", "AppliedEnergistics2", "appliedenergistics2:item.ItemFacade:192");
addToStackMap("appeng.integration.modules.NEIHelpers.NEIGrinderRecipeHandler", "AppliedEnergistics2","appliedenergistics2:item.ItemMultiMaterial:8");
addToStackMap("appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler", "AppliedEnergistics2", "appliedenergistics2:tile.BlockInscriber");
addToStackMap("appeng.integration.modules.NEIHelpers.NEIWorldCraftingHandler", "AppliedEnergistics2", "appliedenergistics2:item.ItemMultiMaterial:9");
}
if (Loader.isModLoaded("OpenComputers")) {
addToStackMap("li.cil.oc.integration.nei.ManualUsageHandler", "OpenComputers", "OpenComputers:item:98");
addToStackMap("li.cil.oc.integration.nei.CallbackDocHandler", "OpenComputers", "OpenComputers:item:98");
}
if (Loader.isModLoaded("AdvancedSolarPanel")) {
addToStackMap("advsolar.client.nei.MTRecipeHandler", "AdvancedSolarPanel", "AdvancedSolarPanel:BlockMolecularTransformer");
}
if (Loader.isModLoaded("AromaBackup")) {
addToStackMap("aroma1997.core.recipes.nei.ShapedAromicRecipeHandler", "AromaBackup", "minecraft:crafting_table");
addToStackMap("aroma1997.core.recipes.nei.ShapelessAromicRecipeHandler", "AromaBackup", "minecraft:crafting_table");
}
if (Loader.isModLoaded("WitcheryExtras")) {
addToStackMap("alkalus.main.nei.NEI_Handler_Cauldron", "witchery", "witchery:cauldron");
addToStackMap("alkalus.main.nei.NEI_Handler_Distillery", "witchery", "witchery:distilleryidle");
@@ -299,11 +316,13 @@ public class GuiRecipeTab extends Button {
addToStackMap("buildcraft.compat.nei.RecipeHandlerAssemblyTable", "BuildCraft", "BuildCraft|Silicon:laserTableBlock");
addToStackMap("buildcraft.compat.nei.RecipeHandlerIntegrationTable", "BuildCraft", "BuildCraft|Silicon:laserTableBlock:2");
}
if (Loader.isModLoaded("BuildCraft|Factory")) {
addToStackMap("buildcraft.compat.nei.RecipeHandlerRefinery", "BuildCraft", "BuildCraft|Factory:refineryBlock");
}
if (Loader.isModLoaded("Thaumcraft")) {
addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapedRecipeHandler", "Thaumcraft", "Thaumcraft:blockTable:15");
addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.ArcaneShapelessRecipeHandler", "Thaumcraft", "Thaumcraft:blockTable:15");
addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.CrucibleRecipeHandler", "Thaumcraft", "Thaumcraft:blockMetalDevice");
addToStackMap("com.djgiannuzz.thaumcraftneiplugin.nei.recipehandler.InfusionRecipeHandler", "Thaumcraft", "Thaumcraft:blockStoneDevice:2");
@@ -313,11 +332,19 @@ public class GuiRecipeTab extends Button {
addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioLabHandler", "BartWorks", "gregtech:gt.blockmachines:12699");
addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_BioVatHandler", "BartWorks", "gregtech:gt.blockmachines:12712");
addToStackMap("com.github.bartimaeusnek.bartworks.neiHandler.BW_NEI_OreHandler", "BartWorks", "bartworks:bw.blockores.01:89");
addToStackMap("gt.recipe.electricimplosioncompressor", "BartWorks", "gregtech:gt.blockmachines:12734"); // Electric implosion compressor
addToStackMap("bw.recipe.cal", "BartWorks", "gregtech:gt.blockmachines:12735");
addToStackMap("bw.fuels.acidgens", "BartWorks", "gregtech:gt.blockmachines:12726");
}
if (Loader.isModLoaded("tectech")) {
addToStackMap("com.github.technus.tectech.nei.TT_NEI_ResearchHandler", "TecTech", "gregtech:gt.blockmachines:15331");
addToStackMap("com.github.technus.tectech.nei.TT_NEI_ScannerHandler", "TecTech", "tectech:item.em.definitionScanStorage");
}
if (Loader.isModLoaded("ExtraUtilities")) {
addToStackMap("com.rwtema.extrautils.nei.EnderConstructorHandler", "ExtraUtilities", "ExtraUtilities:endConstructor");
addToStackMap("com.rwtema.extrautils.nei.FMPMicroBlocksHandler", "ExtraUtilities", "ForgeMicroblock:sawIron");
@@ -325,6 +352,7 @@ public class GuiRecipeTab extends Button {
addToStackMap("com.rwtema.extrautils.nei.MicroBlocksHandler", "ExtraUtilities", "ExtraUtilities:microblocks:1");
addToStackMap("com.rwtema.extrautils.nei.SoulHandler", "ExtraUtilities", "ExtraUtilities:mini-soul");
}
if (Loader.isModLoaded("EnderIO")) {
addToStackMap("crazypants.enderio.nei.AlloySmelterRecipeHandler", "EnderIO", "EnderIO:blockAlloySmelter");
addToStackMap("crazypants.enderio.nei.EnchanterRecipeHandler", "EnderIO", "EnderIO:blockEnchanter");
@@ -348,20 +376,22 @@ public class GuiRecipeTab extends Button {
addToStackMap("forestry.factory.recipes.nei.NEIHandlerSqueezer", "Forestry", "Forestry:factory:5");
addToStackMap("forestry.factory.recipes.nei.NEIHandlerStill", "Forestry", "Forestry:factory:6");
}
if (Loader.isModLoaded("Avaritia")) {
addToStackMap("fox.spiteful.avaritia.compat.nei.CompressionHandler", "Avaritia", "Avaritia:Neutronium_Compressor");
addToStackMap("fox.spiteful.avaritia.compat.nei.ExtremeShapedRecipeHandler", "Avaritia", "Avaritia:Dire_Crafting");
addToStackMap("fox.spiteful.avaritia.compat.nei.ExtremeShapelessRecipeHandler", "Avaritia", "Avaritia:Dire_Crafting");
}
if (Loader.isModLoaded("GalacticraftCore")) {
addToStackMap("galaxyspace.core.nei.rocket.RocketT1RecipeHandler", "Galacticraft", "GalacticraftCore:item.spaceship");
}
if (Loader.isModLoaded("GalacticraftMars")) {
addToStackMap("galaxyspace.core.nei.rocket.RocketT2RecipeHandler", "Galacticraft", "GalacticraftMars:item.spaceshipTier2:1");
addToStackMap("galaxyspace.core.nei.rocket.RocketT3RecipeHandler", "Galacticraft", "GalacticraftMars:item.itemTier3Rocket");
}
if (Loader.isModLoaded("GalaxySpace")) {
addToStackMap("galaxyspace.core.nei.AssemblyMachineRecipeHandler", "GalaxySpace", "GalaxySpace:assemblymachine");
addToStackMap("galaxyspace.core.nei.rocket.RocketT4RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier4Rocket");
@@ -370,37 +400,42 @@ public class GuiRecipeTab extends Button {
addToStackMap("galaxyspace.core.nei.rocket.RocketT7RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier7Rocket");
addToStackMap("galaxyspace.core.nei.rocket.RocketT8RecipeHandler", "GalaxySpace", "GalaxySpace:item.Tier8Rocket");
}
if (Loader.isModLoaded("ProjectBlue")) {
addToStackMap("gcewing.projectblue.nei.NEIRecipeHandler", "ProjectBlue", "ProjectBlue:sprayCan");
}
if (Loader.isModLoaded("miscutils")) {
/* GT++ */
if (Loader.isModLoaded("miscutils")) {
addToStackMap("gtPlusPlus.nei.DecayableRecipeHandler", "GT++", "miscutils:dustRadium226");
addToStackMap("gtPlusPlus.nei.GT_NEI_FlotationCell", "GT++", "gregtech:gt.blockmachines:31028");
addToStackMap("gtPlusPlus.nei.GT_NEI_FluidReactor", "GT++", "gregtech:gt.blockmachines:998");
addToStackMap("gtPlusPlus.nei.GT_NEI_MillingMachine", "GT++", "gregtech:gt.blockmachines:31027");
addToStackMap("gt.recipe.advanced.mixer", "GT++", "gregtech:gt.blockmachines:811");
addToStackMap("gt.recipe.alloyblastsmelter", "gregtech", "gregtech:gt.blockmachines:810"); // ABS
addToStackMap("gt.recipe.cokeoven", "GT++", "gregtech:gt.blockmachines:791"); // ICO
addToStackMap("gt.recipe.cryogenicfreezer", "GT++", "gregtech:gt.blockmachines:910");
addToStackMap("gt.recipe.cyclotron", "GT++", "gregtech:gt.blockmachines:828"); // Cyclotron
addToStackMap("gt.recipe.fishpond", "GT++", "gregtech:gt.blockmachines:829"); // Zhuhai
addToStackMap("gt.recipe.matterfab2", "GT++", "gregtech:gt.blockmachines:799");
addToStackMap("gt.recipe.multicentrifuge", "GT++", "gregtech:gt.blockmachines:790");
addToStackMap("gt.recipe.multielectro", "GT++", "gregtech:gt.blockmachines:796");
addToStackMap("gt.recipe.multielectro", "GT++", "gregtech:gt.blockmachines:796");
addToStackMap("gt.recipe.vacfurnace", "GT++", "gregtech:gt.blockmachines:995");
addToStackMap("gt.recipe.lftr", "GT++", "gregtech:gt.blockmachines:751");
addToStackMap("gt.recipe.lftr.2", "GT++", "gregtech:gt.blockmachines:751");
addToStackMap("gt.recipe.fissionfuel", "GT++", "gregtech:gt.blockmachines:835");
addToStackMap("gt.recipe.vacfurnace", "GT++", "gregtech:gt.blockmachines:995");
addToStackMap("gt.recipe.lftr", "GT++", "gregtech:gt.blockmachines:751");
addToStackMap("gt.recipe.advanced.mixer", "GT++", "gregtech:gt.blockmachines:811");
addToStackMap("gt.recipe.lftr.2", "GT++", "gregtech:gt.blockmachines:751");
addToStackMap("gt.recipe.alloyblastsmelter", "GT++", "gregtech:gt.blockmachines:810");
addToStackMap("gt.recipe.geothermalfuel", "GT++", "gregtech:gt.blockmachines:830");
addToStackMap("gt.recipe.cyclotron", "GT++", "gregtech:gt.blockmachines:828");
addToStackMap("gt.recipe.rocketenginefuel", "GT++", "gregtech:gt.blockmachines:793"); // Basic (EV) rocket fuel gen
addToStackMap("gt.recipe.RTGgenerators", "GT++", "gregtech:gt.blockmachines:869"); // GT++ version of the RTG
addToStackMap("gt.recipe.semifluidgeneratorfuels", "GT++", "gregtech:gt.blockmachines:837"); // Semifluid gen
addToStackMap("gt.recipe.chemicaldehydrator", "GT++", "gregtech:gt.blockmachines:911"); // Dehydrator
addToStackMap("gt.recipe.simplewasher", "GT++", "gregtech:gt.blockmachines:767");
addToStackMap("gt.recipe.matterfab2", "GT++", "gregtech:gt.blockmachines:799");
addToStackMap("gt.recipe.chemicaldehydrator", "GT++", "gregtech:gt.blockmachines:813");
addToStackMap("gt.recipe.slowfusionreactor", "GT++", "gregtech:gt.blockmachines:31015");
addToStackMap("gt.recipe.fishpond", "GT++", "gregtech:gt.blockmachines:829");
addToStackMap("gt.recipe.geothermalfuel", "GT++", "gregtech:gt.blockmachines:830");
addToStackMap("gt.recipe.cokeoven", "GT++", "gregtech:gt.blockmachines:791");
addToStackMap("gt.recipe.slowfusionreactor", "gregtech", "gregtech:gt.blockmachines:31015"); // gt.blockmachines.gtplusplus.fusion.single
}
if (Loader.isModLoaded("Forestry")) {
addToStackMap("hellfirepvp.beebetteratbees.client.gui.BBABGuiRecipeTreeHandler", "Bees", "Forestry:beeQueenGE");
}
@@ -420,6 +455,7 @@ public class GuiRecipeTab extends Button {
addToStackMap("micdoodle8.mods.galacticraft.planets.mars.nei.GasLiquefierRecipeHandler", "Galacticraft", "GalacticraftMars:tile.marsMachineT2");
addToStackMap("micdoodle8.mods.galacticraft.planets.mars.nei.MethaneSynthesizerRecipeHandler", "Galacticraft", "GalacticraftMars:tile.marsMachineT2:4");
}
if (Loader.isModLoaded("ProjRed|Transmission")) {
addToStackMap("mrtjp.projectred.core.libmc.recipe.PRShapedRecipeHandler", "ProjectRed", "ProjRed|Transmission:projectred.transmission.wire:7");
addToStackMap("mrtjp.projectred.core.libmc.recipe.PRShapelessRecipeHandler", "ProjectRed", "ProjRed|Transmission:projectred.transmission.wire:7");
@@ -447,11 +483,12 @@ public class GuiRecipeTab extends Button {
addToStackMap("net.bdew.neiaddons.forestry.butterflies.ButterflyBreedingHandler", "Forestry", "Forestry:butterflyGE");
addToStackMap("net.bdew.neiaddons.forestry.trees.TreeBreedingHandler", "Forestry", "Forestry:saplingGE");
addToStackMap("net.bdew.neiaddons.forestry.trees.TreeProduceHandler", "Forestry", "Forestry:saplingGE");
}
if (Loader.isModLoaded("ae2wct")) {
addToStackMap("net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler", "WirelessCraftingTerminal", "ae2wct:wirelessCraftingTerminal");
}
if (Loader.isModLoaded("gregtech")) {
addToStackMap("pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5SmallOreStat", "Gregtech", "gregtech:gt.blockores:85");
addToStackMap("pers.gwyog.gtneioreplugin.plugin.gregtech5.PluginGT5VeinStat", "Gregtech", "gregtech:gt.blockores:386");
@@ -469,8 +506,9 @@ public class GuiRecipeTab extends Button {
addToStackMap("tconstruct.plugins.nei.RecipeHandlerCastingTable", "Tinker's Construct", "TConstruct:SearedBlock");
addToStackMap("tconstruct.plugins.nei.RecipeHandlerDryingRack", "Tinker's Construct", "TConstruct:Armor.DryingRack");
addToStackMap("tconstruct.plugins.nei.RecipeHandlerMelting", "Tinker's Construct", "TConstruct:LavaTank:2");
addToStackMap("tconstruct.plugins.nei.RecipeHandlerToolMaterials", "Tinker's Construct", "TConstruct:pickaxe");
addToStackMap("tconstruct.plugins.nei.RecipeHandlerToolMaterials", "Tinker's Construct", "TConstruct:ToolStationBlock");
}
if (Loader.isModLoaded("chisel")) {
addToStackMap("team.chisel.compat.nei.RecipeHandlerChisel", "Chisel", "chisel:chisel");
}
@@ -482,19 +520,20 @@ public class GuiRecipeTab extends Button {
addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerPresser", "Pam's Harvestcraft", "harvestcraft:presser");
addToStackMap("tonius.neiintegration.mods.harvestcraft.RecipeHandlerQuern", "Pam's Harvestcraft", "harvestcraft:quern");
}
if (Loader.isModLoaded("harvestcraft")) {
addToStackMap("tonius.neiintegration.mods.mcforge.RecipeHandlerFluidRegistry", "Minecraft", "minecraft:water");
addToStackMap("tonius.neiintegration.mods.mcforge.RecipeHandlerOreDictionary", "Minecraft", "minecraft:iron_ore");
}
if (Loader.isModLoaded("GalacticraftCoRailcraftre")) {
if (Loader.isModLoaded("Railcraft")) {
addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerBlastFurnace", "Railcraft", "Railcraft:machine.alpha:12");
addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerCokeOven", "Railcraft", "Railcraft:machine.alpha:7");
addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRockCrusher", "Railcraft", "Railcraft:machine.alpha:15");
addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShaped", "Railcraft", "Railcraft:machine.alpha:8");
addToStackMap("tonius.neiintegration.mods.railcraft.RecipeHandlerRollingMachineShapeless", "Railcraft", "Railcraft:machine.alpha:8");
}
/* Blood Magic */
if (Loader.isModLoaded("AWWayofTime")) {
addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIAlchemyRecipeHandler", "BloodMagic", "AWWayofTime:blockWritingTable");
addToStackMap("WayofTime.alchemicalWizardry.client.nei.NEIAltarRecipeHandler", "BloodMagic", "AWWayofTime:Altar");
@@ -508,7 +547,7 @@ public class GuiRecipeTab extends Button {
addToStackMap("witchinggadgets.client.nei.NEISpinningWheelHandler", "WitchingGadgets", "WitchingGadgets:WG_WoodenDevice");
}
/* Witchery */
{
if (Loader.isModLoaded("witchery")) {
addToStackMap("com.emoniph.witchery.integration.NEICauldronRecipeHandler", "witchery", "witchery:cauldron");
addToStackMap("com.emoniph.witchery.integration.NEISpinningWheelRecipeHandler", "witchery", "witchery:spinningwheel");
addToStackMap("com.emoniph.witchery.integration.NEIWitchesOvenRecipeHandler", "witchery", "witchery:witchesovenidle");
@@ -531,7 +570,8 @@ public class GuiRecipeTab extends Button {
final ItemStack itemStack;
int meta = -1;
if (!item_id.contains(":")) {
throw new IllegalArgumentException("Item ID missing colon");
NEIClientConfig.logger.info("Item ID missing colon for handler " + handler + " - " + modname);
return;
}
final String[] split = item_id.split(":");
item_id = split[0] + ":" + split[1];
@@ -555,9 +595,9 @@ public class GuiRecipeTab extends Button {
if (itemStack != null)
stackMap.put(handler, new ImmutablePair<>(modname, itemStack));
else
System.out.println("Couldn't find " + modname + " - " + item_id);
NEIClientConfig.logger.info("Couldn't find " + modname + " - " + item_id);
}
private static void addToIconMap(String handler, String modid, Image image) {
iconMap.put(handler, new ImmutablePair<>(modid, image));
private static void addToIconMap(String handler, String modname, DrawableResource image) {
imageMap.put(handler, new ImmutablePair<>(modname, image));
}
}
@@ -0,0 +1,47 @@
package codechicken.nei.recipe;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
public class GuiRecipeTabCreative extends GuiRecipeTab {
public static final int TAB_WIDTH = 28;
public static final int TAB_HEIGHT = 31;
private static final DrawableResource selectedTabImage = new DrawableBuilder("minecraft:textures/gui/container/creative_inventory/tabs.png", 28, 32, 28, 32).build();
private static final DrawableResource unselectedTabImage = new DrawableBuilder("minecraft:textures/gui/container/creative_inventory/tabs.png", 28, 0, 28, 30).build();
public GuiRecipeTabCreative(GuiRecipe guiRecipe, IRecipeHandler handler, int x, int y) {
super(guiRecipe, handler, x, y);
}
@Override
public int getWidth() {
return TAB_WIDTH;
}
@Override
public int getHeight() {
return TAB_HEIGHT;
}
@Override
protected int getForegroundIconX() {
return x + (w - 16) / 2;
}
@Override
protected int getForegroundIconY() {
return y + h - 22;
}
@Override
public DrawableResource getSelectedTabImage() {
return selectedTabImage;
}
@Override
public DrawableResource getUnselectedTabImage() {
return unselectedTabImage;
}
}
@@ -0,0 +1,47 @@
package codechicken.nei.recipe;
import codechicken.nei.drawable.DrawableBuilder;
import codechicken.nei.drawable.DrawableResource;
public class GuiRecipeTabJEI extends GuiRecipeTab {
public static final int TAB_WIDTH = 24;
public static final int TAB_HEIGHT = 24;
private static final DrawableResource selectedTabImage = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 0, 16, 24, 24).build();
private static final DrawableResource unselectedTabImage = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 24, 16, 24, 24).build();
public GuiRecipeTabJEI(GuiRecipe guiRecipe, IRecipeHandler handler, int x, int y) {
super(guiRecipe, handler, x, y);
}
@Override
public int getWidth() {
return TAB_WIDTH;
}
@Override
public int getHeight() {
return TAB_HEIGHT;
}
@Override
protected int getForegroundIconX() {
return x + 4;
}
@Override
protected int getForegroundIconY() {
return y + 4;
}
@Override
public DrawableResource getSelectedTabImage() {
return selectedTabImage;
}
@Override
public DrawableResource getUnselectedTabImage() {
return unselectedTabImage;
}
}
+46 -24
View File
@@ -2,8 +2,9 @@ package codechicken.nei.recipe;
import codechicken.nei.Button;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import java.awt.Rectangle;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -13,23 +14,37 @@ public class GuiRecipeTabs {
private final List<Button> buttons = new ArrayList<>();
private final Rectangle area = new Rectangle();
private boolean creative_tab_style;
private int pageCount = 1;
private int pageNumber = 0;
private int categoriesPerPage = 1;
private int numHandlers = 1;
private int tabWidth;
private int tabHeight;
public GuiRecipeTabs(GuiRecipe guiRecipe) {
this.guiRecipe = guiRecipe;
}
public void initLayout() {
creative_tab_style = NEIClientConfig.useCreativeTabStyle();
if(creative_tab_style) {
tabWidth = GuiRecipeTabCreative.TAB_WIDTH;
tabHeight = GuiRecipeTabCreative.TAB_HEIGHT;
} else {
tabWidth = GuiRecipeTabJEI.TAB_WIDTH;
tabHeight = GuiRecipeTabJEI.TAB_HEIGHT;
}
int totalWidth = 0;
categoriesPerPage = 0;
numHandlers = guiRecipe.currenthandlers.size();
for (IRecipeHandler handler : guiRecipe.currenthandlers) {
if (totalWidth + GuiRecipeTab.TAB_WIDTH < (guiRecipe.xSize - 4)) {
totalWidth += GuiRecipeTab.TAB_WIDTH;
if (totalWidth + tabWidth < (guiRecipe.xSize - 4)) {
totalWidth += tabWidth;
categoriesPerPage++;
} else {
break;
@@ -37,9 +52,9 @@ public class GuiRecipeTabs {
}
area.width = totalWidth;
area.height = GuiRecipeTab.TAB_HEIGHT;
area.x = guiRecipe.guiLeft + 2;
area.y = guiRecipe.guiTop - GuiRecipeTab.TAB_HEIGHT + 3;
area.height = tabHeight;
area.x = guiRecipe.guiLeft + 4;
area.y = guiRecipe.guiTop - tabHeight + 3;
pageCount = (int) Math.ceil((float) numHandlers / categoriesPerPage);
calcPageNumber();
@@ -56,51 +71,58 @@ public class GuiRecipeTabs {
tabs.clear();
buttons.clear();
int tabX = area.x;
final int startIndex = pageNumber * categoriesPerPage;
for (int i = 0 ; i < categoriesPerPage ; i++) {
final int index = i + startIndex;
if (index >= numHandlers) break;
IRecipeHandler handler = guiRecipe.currenthandlers.get(index);
tabs.add(new GuiRecipeTab(guiRecipe, handler, tabX, area.y));
tabX += GuiRecipeTab.TAB_WIDTH;
int tabX = area.x + (i * tabWidth);
if(NEIClientConfig.useCreativeTabStyle())
tabs.add(new GuiRecipeTabCreative(guiRecipe, handler, tabX, area.y));
else
tabs.add(new GuiRecipeTabJEI(guiRecipe, handler, tabX, area.y));
}
// Maybe add buttons
if (numHandlers > categoriesPerPage) {
Button prevTab = new Button("prevTab") {
@Override
public boolean onButtonPress(boolean rightclick) {
if (!rightclick) return previousPage();
else return false;
public boolean onButtonPress(boolean rightClick) {
if (!rightClick) {
NEIClientUtils.playClickSound();
return previousPage();
} else
return false;
}
@Override
public String getRenderLabel() {
return "<";
}
};
prevTab.x = area.x - 7;
prevTab.y = area.y + 2;
prevTab.h = 20;
prevTab.w = 8;
prevTab.h = tabHeight - 4;
prevTab.x = area.x - prevTab.w + 1;
prevTab.y = area.y + 2;
buttons.add(prevTab);
Button nextTab = new Button("nextTab") {
@Override
public boolean onButtonPress(boolean rightclick) {
if(!rightclick) return nextPage();
else return false;
if (!rightclick) {
NEIClientUtils.playClickSound();
return nextPage();
} else return false;
}
@Override
public String getRenderLabel() {
return ">";
}
};
nextTab.x = area.x + area.width;
nextTab.y = area.y + 2;
nextTab.h = 20;
nextTab.w = 8;
nextTab.w = prevTab.w;
nextTab.h = prevTab.h;
nextTab.x = area.x + area.width - 1;
nextTab.y = prevTab.y;
buttons.add(nextTab);
}
}
@@ -133,8 +155,8 @@ public class GuiRecipeTabs {
public void draw(int mouseX, int mouseY) {
IRecipeHandler current = guiRecipe.currenthandlers.get(guiRecipe.recipetype);
for (GuiRecipeTab tab : tabs) {
boolean selected = tab.isSelected(current);
tab.draw(selected, mouseX, mouseY);
tab.setSelected(current);
tab.draw(mouseX, mouseY);
}
for (Button button : buttons) {
button.draw(mouseX, mouseY);