mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 03:25:38 +00:00
* Focus the previous recipe if it's still visible when loading usage recipes. * Reduced code duplication by extracting getRecipeHandlers * Moved RecipeHandlerQuery to its own package-private file * Refactored RecipeHandlerQuery methods * Saving the current recipe when left clicking a machine's "Recipes" button * Restored prevScreen so we can restore it with overlay * Genericized GuiRecipe so that currentHandlers is no longer hidden in subclasses * Cleaned up overlay handling * Fixed trivial IDE warnings & bad JavaDoc on files I touched
48 lines
1.3 KiB
Java
48 lines
1.3 KiB
Java
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;
|
|
}
|
|
}
|