From 8e1541eab1935a2a261afcabaeb822089a94d86b Mon Sep 17 00:00:00 2001 From: slprime <31038811+slprime@users.noreply.github.com> Date: Wed, 4 Nov 2026 16:34:56 +0200 Subject: [PATCH] Remove creative tab style option for recipe tabs (#1107) --- .../java/codechicken/nei/NEIClientConfig.java | 8 --- .../codechicken/nei/recipe/GuiRecipeTab.java | 56 +++++++++---------- .../nei/recipe/GuiRecipeTabCreative.java | 56 ------------------- .../nei/recipe/GuiRecipeTabJEI.java | 56 ------------------- .../codechicken/nei/recipe/GuiRecipeTabs.java | 30 +++------- src/main/resources/assets/nei/lang/en_US.lang | 3 - src/main/resources/assets/nei/lang/ru_RU.lang | 3 - src/main/resources/assets/nei/lang/uk_UA.lang | 3 - src/main/resources/assets/nei/lang/zh_CN.lang | 3 - 9 files changed, 37 insertions(+), 181 deletions(-) delete mode 100644 src/main/java/codechicken/nei/recipe/GuiRecipeTabCreative.java delete mode 100644 src/main/java/codechicken/nei/recipe/GuiRecipeTabJEI.java diff --git a/src/main/java/codechicken/nei/NEIClientConfig.java b/src/main/java/codechicken/nei/NEIClientConfig.java index ea4cfa63..1a532500 100644 --- a/src/main/java/codechicken/nei/NEIClientConfig.java +++ b/src/main/java/codechicken/nei/NEIClientConfig.java @@ -256,10 +256,6 @@ public class NEIClientConfig { .getBooleanValue(true); API.addOption(new OptionToggleButton("inventory.guirecipe.cycledIngredientsTooltip", true)); - tag.getTag("inventory.guirecipe.creativeTabStyle").setComment("Creative or JEI style tabs") - .getBooleanValue(false); - API.addOption(new OptionToggleButton("inventory.guirecipe.creativeTabStyle", true)); - tag.getTag("inventory.guirecipe.itemPresenceOverlay").setComment("Item presence overlay on ?-hover") .getIntValue(1); API.addOption(new OptionCycled("inventory.guirecipe.itemPresenceOverlay", 3, true)); @@ -1156,10 +1152,6 @@ public class NEIClientConfig { return getIntSetting("inventory.guirecipe.jeiStyleRecipeCatalyst"); } - public static boolean useCreativeTabStyle() { - return getBooleanSetting("inventory.guirecipe.creativeTabStyle"); - } - public static boolean ignorePotionOverlap() { return getBooleanSetting("inventory.bookmarks.ignorePotionOverlap"); } diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java index 156acc69..521a6f68 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java @@ -26,6 +26,7 @@ import codechicken.nei.ColorUtils; import codechicken.nei.NEIClientConfig; import codechicken.nei.NEIClientUtils; import codechicken.nei.Widget; +import codechicken.nei.drawable.DrawableBuilder; import codechicken.nei.drawable.DrawableResource; import codechicken.nei.event.NEIRegisterHandlerInfosEvent; import codechicken.nei.guihook.GuiContainerManager; @@ -43,26 +44,29 @@ public abstract class GuiRecipeTab extends Widget { protected final String handlerName; protected final String handlerID; + 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(); + 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(IRecipeHandler handler, int x, int y) { super(); this.x = x; this.y = y; - this.w = getWidth(); - this.h = getHeight(); + this.w = TAB_WIDTH; + this.h = TAB_HEIGHT; this.handler = handler; this.handlerName = handler.getHandlerId(); this.selected = false; @@ -83,21 +87,16 @@ public abstract class GuiRecipeTab extends Widget { public void drawBackground(int mouseX, int mouseY) { GL11.glDisable(GL11.GL_LIGHTING); GL11.glColor4f(1, 1, 1, 1); - 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); + final DrawableResource image = this.selected ? selectedTabImage : unselectedTabImage; + image.draw(this.x, this.y); } public void drawForeground(int mouseX, int mouseY) { - final int iconX = getForegroundIconX(); - final int iconY = getForegroundIconY(); + final int iconX = this.x + 4; + final int iconY = this.y + 4; final FontRenderer fontRenderer = GuiDraw.fontRenderer; - final HandlerInfo handlerInfo = getHandlerInfo(handlerName, handlerID); + final HandlerInfo handlerInfo = getHandlerInfo(this.handlerName, this.handlerID); final DrawableResource icon = handlerInfo != null ? handlerInfo.getImage() : null; final ItemStack itemStack = handlerInfo != null ? handlerInfo.getItemStack() : null; @@ -112,7 +111,7 @@ public abstract class GuiRecipeTab extends Widget { if (!isEnabled) GL11.glDisable(GL12.GL_RESCALE_NORMAL); } else { // Text fallback - String text = handler.getRecipeName(); + String text = this.handler.getRecipeName(); if (text != null && text.length() > 0) { if (text.length() > 2) { text = text.substring(0, 2); @@ -121,9 +120,10 @@ public abstract class GuiRecipeTab extends Widget { text = "??"; } - int textCenterX = x + (int) (getWidth() / 2f); - int textCenterY = y + (int) (getHeight() / 2f) - 3; - int color = selected ? ColorUtils.buttonLabelHover.getColor() : ColorUtils.buttonLabelNormal.getColor(); + int textCenterX = this.x + (int) (this.w / 2f); + int textCenterY = this.y + (int) (this.h / 2f) - 3; + int color = this.selected ? ColorUtils.buttonLabelHover.getColor() + : ColorUtils.buttonLabelNormal.getColor(); fontRenderer.drawStringWithShadow( text, textCenterX - (int) (fontRenderer.getStringWidth(text) / 2f), diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTabCreative.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTabCreative.java deleted file mode 100644 index 30ebd32d..00000000 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTabCreative.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.nei.recipe; - -import codechicken.nei.drawable.DrawableBuilder; -import codechicken.nei.drawable.DrawableResource; - -public abstract 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(IRecipeHandler handler, int x, int y) { - super(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; - } -} diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTabJEI.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTabJEI.java deleted file mode 100644 index 344b9cf6..00000000 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTabJEI.java +++ /dev/null @@ -1,56 +0,0 @@ -package codechicken.nei.recipe; - -import codechicken.nei.drawable.DrawableBuilder; -import codechicken.nei.drawable.DrawableResource; - -public abstract 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(IRecipeHandler handler, int x, int y) { - super(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; - } -} diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java index e37eb634..d3f4c641 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipeTabs.java @@ -47,11 +47,11 @@ public class GuiRecipeTabs { }; public static int getTabWidth() { - return NEIClientConfig.useCreativeTabStyle() ? GuiRecipeTabCreative.TAB_WIDTH : GuiRecipeTabJEI.TAB_WIDTH; + return GuiRecipeTab.TAB_WIDTH; } public static int getTabHeight() { - return NEIClientConfig.useCreativeTabStyle() ? GuiRecipeTabCreative.TAB_HEIGHT : GuiRecipeTabJEI.TAB_HEIGHT; + return GuiRecipeTab.TAB_HEIGHT; } public void update(GuiRecipe guiRecipe) { @@ -85,27 +85,15 @@ public class GuiRecipeTabs { final IRecipeHandler handler = this.currenthandlers.get(index); final int tabX = this.area.x + (i * tabWidth); - if (NEIClientConfig.useCreativeTabStyle()) { - tabs.add(new GuiRecipeTabCreative(handler, tabX, this.area.y) { + this.tabs.add(new GuiRecipeTab(handler, tabX, this.area.y) { - @Override - public boolean onButtonPress(boolean rightclick) { - setRecipePage(index); - return true; - } + @Override + public boolean onButtonPress(boolean rightclick) { + setRecipePage(index); + return true; + } - }); - } else { - tabs.add(new GuiRecipeTabJEI(handler, tabX, this.area.y) { - - @Override - public boolean onButtonPress(boolean rightclick) { - setRecipePage(index); - return true; - } - - }); - } + }); } } diff --git a/src/main/resources/assets/nei/lang/en_US.lang b/src/main/resources/assets/nei/lang/en_US.lang index 5eae7b18..2b7ce60f 100644 --- a/src/main/resources/assets/nei/lang/en_US.lang +++ b/src/main/resources/assets/nei/lang/en_US.lang @@ -412,9 +412,6 @@ nei.options.inventory.search.subsetsSearchMode=Item Subsets Search nei.options.inventory.search.subsetsSearchMode.0=Always nei.options.inventory.search.subsetsSearchMode.1=Prefix: %s nei.options.inventory.search.subsetsSearchMode.2=Never -nei.options.inventory.guirecipe.creativeTabStyle=Creative or JEI tab style -nei.options.inventory.guirecipe.creativeTabStyle.true=Creative -nei.options.inventory.guirecipe.creativeTabStyle.false=JEI nei.options.inventory.optimize_gui_overlap_computation=Optimize computation for GUI overlap nei.options.inventory.optimize_gui_overlap_computation.true=Yes nei.options.inventory.optimize_gui_overlap_computation.false=No diff --git a/src/main/resources/assets/nei/lang/ru_RU.lang b/src/main/resources/assets/nei/lang/ru_RU.lang index 19a112bb..6eddd969 100644 --- a/src/main/resources/assets/nei/lang/ru_RU.lang +++ b/src/main/resources/assets/nei/lang/ru_RU.lang @@ -251,9 +251,6 @@ nei.options.inventory.search.subsetsSearchMode=Поиск по подмноже nei.options.inventory.search.subsetsSearchMode.0=Всегда nei.options.inventory.search.subsetsSearchMode.1=Префикс: %s nei.options.inventory.search.subsetsSearchMode.2=Никогда -nei.options.inventory.guirecipe.creativeTabStyle=Стиль вкладок: Творческий или JEI -nei.options.inventory.guirecipe.creativeTabStyle.true=Творческий -nei.options.inventory.guirecipe.creativeTabStyle.false=JEI nei.options.inventory.optimize_gui_overlap_computation=Оптимизация вычислений при перекрытии GUI nei.options.inventory.optimize_gui_overlap_computation.true=Да nei.options.inventory.optimize_gui_overlap_computation.false=Нет diff --git a/src/main/resources/assets/nei/lang/uk_UA.lang b/src/main/resources/assets/nei/lang/uk_UA.lang index 30c38572..6522c791 100644 --- a/src/main/resources/assets/nei/lang/uk_UA.lang +++ b/src/main/resources/assets/nei/lang/uk_UA.lang @@ -359,9 +359,6 @@ nei.options.inventory.search.subsetsSearchMode=Пошук у підгрупах nei.options.inventory.search.subsetsSearchMode.0=Завжди nei.options.inventory.search.subsetsSearchMode.1=Префікс: %s nei.options.inventory.search.subsetsSearchMode.2=Ніколи -nei.options.inventory.guirecipe.creativeTabStyle=Стиль вкладок Creative чи JEI -nei.options.inventory.guirecipe.creativeTabStyle.true=Creative -nei.options.inventory.guirecipe.creativeTabStyle.false=JEI nei.options.inventory.optimize_gui_overlap_computation=Оптимізувати обчислення перекриття інтерфейсів nei.options.inventory.optimize_gui_overlap_computation.true=Так nei.options.inventory.optimize_gui_overlap_computation.false=Ні diff --git a/src/main/resources/assets/nei/lang/zh_CN.lang b/src/main/resources/assets/nei/lang/zh_CN.lang index d60788f4..1d7a4ff3 100644 --- a/src/main/resources/assets/nei/lang/zh_CN.lang +++ b/src/main/resources/assets/nei/lang/zh_CN.lang @@ -137,9 +137,6 @@ nei.options.inventory.bookmarks.showRecipeMarker.0=否 nei.options.inventory.showItemQuantityWidget=显示物品数量栏(右下角) nei.options.inventory.showItemQuantityWidget.true=是 nei.options.inventory.showItemQuantityWidget.false=否 -nei.options.inventory.guirecipe.creativeTabStyle=创造模式/JEI标签页 -nei.options.inventory.guirecipe.creativeTabStyle.true=创造模式 -nei.options.inventory.guirecipe.creativeTabStyle.false=JEI nei.options.inventory.bookmarks.ignorePotionOverlap=忽略书签与药水效果重叠 nei.options.inventory.bookmarks.ignorePotionOverlap.true=忽略 nei.options.inventory.bookmarks.ignorePotionOverlap.false=规避