mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
add config
This commit is contained in:
1 parent
c75420b31d
commit
29fe442671
6 files changed
+26
-9
No files matched your search
@@ -188,6 +188,8 @@ public class NEIClientConfig {
|
||||
API.addOption(new OptionToggleButtonBoubs("inventory.jei_style_tabs", true));
|
||||
tag.getTag("inventory.jei_style_item_presence_overlay").setComment("Enable/disable JEI Style item presence overlay on ?-hover").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_item_presence_overlay", true));
|
||||
tag.getTag("inventory.jei_style_recipe_catalyst").setComment("Enable/disable JEI Style Recipe Catalysts [experimental]").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.jei_style_recipe_catalyst", true));
|
||||
|
||||
|
||||
tag.getTag("inventory.creative_tab_style").setComment("Creative or JEI style tabs").getBooleanValue(false);
|
||||
@@ -376,6 +378,9 @@ public class NEIClientConfig {
|
||||
public static boolean isJEIStyleItemPresenceOverlayVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_item_presence_overlay");
|
||||
}
|
||||
public static boolean areJEIStyleRecipeCatalystsVisible() {
|
||||
return getBooleanSetting("inventory.jei_style_recipe_catalyst");
|
||||
}
|
||||
public static boolean useCreativeTabStyle() {
|
||||
return getBooleanSetting("inventory.creative_tab_style");
|
||||
}
|
||||
|
||||
@@ -597,7 +597,9 @@ public abstract class GuiRecipe extends GuiContainer implements IGuiContainerOve
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
|
||||
recipeTabs.draw(mouseX, mouseY);
|
||||
guiRecipeCatalyst.draw();
|
||||
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
guiRecipeCatalyst.draw();
|
||||
}
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,18 @@ public class GuiUsageRecipe extends GuiRecipe
|
||||
handlers = serialUsageHandlers.stream().map(h -> h.getUsageHandler(inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
|
||||
.map(h -> h.getUsageAndCatalystHandler(inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new))).get());
|
||||
|
||||
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
|
||||
.map(h -> h.getUsageAndCatalystHandler(inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new))).get());
|
||||
} else {
|
||||
handlers.addAll(ItemList.forkJoinPool.submit(() -> usagehandlers.parallelStream()
|
||||
.map(h -> h.getUsageHandler(inputId, ingredients))
|
||||
.filter(h -> h.numRecipes() > 0)
|
||||
.collect(Collectors.toCollection(ArrayList::new))).get());
|
||||
}
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
|
||||
@@ -29,7 +29,9 @@ public class RecipeCatalysts {
|
||||
}
|
||||
|
||||
public static List<PositionedStack> getRecipeCatalysts(Class<? extends IRecipeHandler> handler) {
|
||||
if (!NEIClientConfig.areJEIStyleTabsVisible()) return Collections.emptyList();
|
||||
if (!NEIClientConfig.areJEIStyleTabsVisible() || !NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return positionedRecipeCatalystMap.getOrDefault(handler, Collections.emptyList());
|
||||
}
|
||||
|
||||
|
||||
@@ -556,8 +556,6 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
* Fallback to {@link TemplateRecipeHandler#getUsageHandler}.
|
||||
*/
|
||||
public IUsageHandler getUsageAndCatalystHandler(String inputId, Object... ingredients) {
|
||||
if (!NEIClientConfig.areJEIStyleTabsVisible()) return this.getUsageHandler(inputId, ingredients);
|
||||
|
||||
TemplateRecipeHandler handler = newInstance();
|
||||
if (inputId.equals("item")) {
|
||||
ItemStack candidate = (ItemStack) ingredients[0];
|
||||
|
||||
Reference in new issue
Block a user