Files
sanctuary-beta/mods/jei/patches/26.3.patch
T
2026-09-16 11:41:27 +02:00

1492 lines
76 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--- /dev/null
+++ b/Common/src/api/java/mezz/jei/api/sanctuary/CatalogueAccess.java
@@ -0,0 +1,18 @@
+package mezz.jei.api.sanctuary;
+
+import java.util.List;
+import java.util.function.BooleanSupplier;
+import java.util.function.BiFunction;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.inventory.Slot;
+
+/** Sanctuary fork bridge. Defaults retain JEI behavior outside Sanctuary. */
+public final class CatalogueAccess {
+ private CatalogueAccess() {}
+ public static BooleanSupplier configButtonVisible = () -> true;
+ public static BooleanSupplier allowed = () -> true;
+ public static BooleanSupplier blueprints = () -> false;
+ public static java.util.function.BiPredicate<mezz.jei.api.recipe.category.IRecipeCategory<?>,Object> recipe = (category,value) -> true;
+ public static java.util.function.Predicate<net.minecraft.world.item.ItemStack> ingredient = item -> true;
+ public static BiFunction<AbstractContainerMenu,List<Slot>,List<Slot>> inventory = (menu,slots) -> slots;
+}
--- a/Common/src/main/java/mezz/jei/common/config/ClientToggleState.java
+++ b/Common/src/main/java/mezz/jei/common/config/ClientToggleState.java
@@ -13,7 +13,7 @@
@Override
public boolean isOverlayEnabled() {
- return overlayEnabled;
+ return overlayEnabled && mezz.jei.api.sanctuary.CatalogueAccess.allowed.getAsBoolean();
}
@Override
--- a/Common/src/main/java/mezz/jei/common/input/keys/AbstractJeiKeyMappingBuilder.java
+++ b/Common/src/main/java/mezz/jei/common/input/keys/AbstractJeiKeyMappingBuilder.java
@@ -1,7 +1,7 @@
package mezz.jei.common.input.keys;
import com.mojang.blaze3d.platform.InputConstants;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
public abstract class AbstractJeiKeyMappingBuilder implements IJeiKeyMappingBuilder {
protected abstract IJeiKeyMappingInternal buildMouse(int mouseButton);
@@ -23,6 +23,6 @@
@Override
public final IJeiKeyMappingInternal buildUnbound() {
- return buildKeyboardKey(GLFW.GLFW_KEY_UNKNOWN);
+ return buildKeyboardKey(InputConstants.UNKNOWN.getValue());
}
}
--- a/Common/src/main/java/mezz/jei/common/input/keys/IJeiKeyMappingInternal.java
+++ b/Common/src/main/java/mezz/jei/common/input/keys/IJeiKeyMappingInternal.java
@@ -4,7 +4,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.KeyMapping;
import net.minecraft.network.chat.Component;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
import java.util.function.Consumer;
@@ -34,9 +34,8 @@
Minecraft minecraft = Minecraft.getInstance();
long windowHandle = minecraft.getWindow().handle();
return switch (key.getType()) {
- case KEYSYM -> InputConstants.isKeyDown(minecraft.getWindow(), key.getValue());
- case MOUSE -> GLFW.glfwGetMouseButton(windowHandle, key.getValue()) == GLFW.GLFW_PRESS;
- case SCANCODE -> false;
+ case KEYBOARD -> InputConstants.isKeyDown(key.getValue());
+ case MOUSE -> (org.lwjgl.sdl.SDLMouse.SDL_GetMouseState((java.nio.FloatBuffer)null, (java.nio.FloatBuffer)null) & (1 << (key.getValue()-1))) != 0;
};
}
}
--- a/Common/src/main/java/mezz/jei/common/input/keys/JeiKeyModifier.java
+++ b/Common/src/main/java/mezz/jei/common/input/keys/JeiKeyModifier.java
@@ -5,7 +5,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.input.InputQuirks;
import net.minecraft.network.chat.Component;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
public enum JeiKeyModifier {
CONTROL {
@@ -26,7 +26,7 @@
if (InputQuirks.REPLACE_CTRL_KEY_WITH_CMD_KEY) {
Minecraft minecraft = Minecraft.getInstance();
Window window = minecraft.getWindow();
- return InputConstants.isKeyDown(window, GLFW.GLFW_KEY_LEFT_SUPER) || InputConstants.isKeyDown(window, GLFW.GLFW_KEY_RIGHT_SUPER);
+ return InputConstants.isKeyDown(InputConstants.KEY_LGUI) || InputConstants.isKeyDown(InputConstants.KEY_RGUI);
}
return CONTROL.isActive(context);
}
--- a/Common/src/main/java/mezz/jei/common/platform/IPlatformBrewingHelper.java
+++ b/Common/src/main/java/mezz/jei/common/platform/IPlatformBrewingHelper.java
@@ -6,7 +6,7 @@
import mezz.jei.api.runtime.IIngredientManager;
import mezz.jei.common.recipes.BrewingExtensionHelper;
import net.minecraft.util.context.ContextMap;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import java.util.List;
@@ -27,7 +27,7 @@
List<IJeiBrewingRecipe> getBrewingRecipes(
IIngredientManager ingredientManager,
IVanillaRecipeFactory vanillaRecipeFactory,
- PotionBrewing potionBrewing,
+ RecipeMap potionBrewing,
ContextMap contextMap,
BrewingExtensionHelper brewingExtensionHelper
);
--- a/Common/src/main/java/mezz/jei/common/platform/IPlatformIngredientHelper.java
+++ b/Common/src/main/java/mezz/jei/common/platform/IPlatformIngredientHelper.java
@@ -4,7 +4,7 @@
import net.minecraft.core.HolderSet;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.crafting.Ingredient;
@@ -12,9 +12,9 @@
import java.util.stream.Stream;
public interface IPlatformIngredientHelper {
- List<Ingredient> getPotionContainers(PotionBrewing potionBrewing);
+ List<Ingredient> getPotionContainers(RecipeMap potionBrewing);
- Stream<Ingredient> getPotionIngredients(PotionBrewing potionBrewing);
+ Stream<Ingredient> getPotionIngredients(RecipeMap potionBrewing);
float getCompostValue(ItemStack itemStack);
--- a/Common/src/main/java/mezz/jei/common/platform/IPlatformItemStackHelper.java
+++ b/Common/src/main/java/mezz/jei/common/platform/IPlatformItemStackHelper.java
@@ -10,14 +10,13 @@
import net.minecraft.world.item.component.ItemAttributeModifiers;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.item.enchantment.Enchantment;
-import net.minecraft.world.level.block.entity.FuelValues;
import org.jspecify.annotations.Nullable;
import java.util.List;
import java.util.Optional;
public interface IPlatformItemStackHelper {
- int getBurnTime(ItemStack itemStack, RecipeType<?> recipeType, FuelValues fuelValues);
+ int getBurnTime(ItemStack itemStack, RecipeType<?> recipeType);
Optional<String> getCreatorModId(ItemStack stack);
--- a/Common/src/main/java/mezz/jei/common/platform/IPlatformRenderHelper.java
+++ b/Common/src/main/java/mezz/jei/common/platform/IPlatformRenderHelper.java
@@ -1,6 +1,6 @@
package mezz.jei.common.platform;
-import com.mojang.blaze3d.pipeline.RenderPipeline;
+import com.mojang.renderpearl.api.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.datafixers.util.Either;
import net.minecraft.client.Minecraft;
--- /dev/null
+++ b/Common/src/main/java/mezz/jei/common/recipes/RecipeMaps.java
@@ -0,0 +1,15 @@
+package mezz.jei.common.recipes;
+import com.mojang.serialization.Lifecycle;
+import java.util.Collection;
+import net.minecraft.core.MappedRegistry;
+import net.minecraft.core.RegistrationInfo;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.world.item.crafting.*;
+public final class RecipeMaps {
+ private RecipeMaps() {}
+ public static RecipeMap create(Collection<RecipeHolder<?>> recipes) {
+ var registry=new MappedRegistry<Recipe<?>>(Registries.RECIPE,Lifecycle.stable());
+ for(var holder:recipes)registry.register(holder.id(),holder.value(),RegistrationInfo.BUILT_IN);
+ return RecipeMap.create(registry.freeze());
+ }
+}
--- a/Common/src/main/java/mezz/jei/common/recipes/VanillaClientRecipeLoader.java
+++ b/Common/src/main/java/mezz/jei/common/recipes/VanillaClientRecipeLoader.java
@@ -50,13 +50,13 @@
try (CloseableResourceManager resourceManager = createVanillaServerDataResourceManager()) {
RegistryOps<JsonElement> ops = createVanillaServerDataSerializationContext(registryAccess, resourceManager);
- SimpleJsonResourceReloadListener.scanDirectory(
- resourceManager,
- RECIPE_LISTER,
- ops,
- Recipe.CODEC,
- recipes
- );
+ for(var entry:RECIPE_LISTER.listMatchingResources(resourceManager).entrySet()) {
+ try(var reader=entry.getValue().openAsReader()) {
+ Recipe.DIRECT_CODEC.parse(ops,com.google.gson.JsonParser.parseReader(reader))
+ .resultOrPartial(error -> LOGGER.warn("Cannot read vanilla recipe {}: {}",entry.getKey(),error))
+ .ifPresent(recipe -> recipes.put(RECIPE_LISTER.fileToId(entry.getKey()),recipe));
+ } catch(java.io.IOException error) {LOGGER.warn("Cannot read vanilla recipe {}",entry.getKey(),error);}
+ }
} catch (RuntimeException e) {
LOGGER.error("Failed to load vanilla recipes from client resources.", e);
return RecipeMap.EMPTY;
@@ -68,7 +68,7 @@
recipeHolders.add(new RecipeHolder<>(key, recipe));
});
- RecipeMap recipeMap = RecipeMap.create(recipeHolders);
+ RecipeMap recipeMap = RecipeMaps.create(recipeHolders);
LOGGER.info("Loaded {} vanilla recipes from client resources.", recipeMap.values().size());
return recipeMap;
}
@@ -76,7 +76,7 @@
private static CloseableResourceManager createVanillaServerDataResourceManager() {
return new MultiPackResourceManager(
PackType.SERVER_DATA,
- List.of(ServerPacksSource.createVanillaPackSource())
+ List.of(ServerPacksSource.createVanillaPackSource().fullResources())
);
}
--- a/Common/src/main/java/mezz/jei/common/transfer/BasicRecipeTransferHandlerServer.java
+++ b/Common/src/main/java/mezz/jei/common/transfer/BasicRecipeTransferHandlerServer.java
@@ -373,7 +373,7 @@
ItemStack remainder = stowItem(player, inventorySlots, itemStack);
if (!remainder.isEmpty()) {
if (!player.getInventory().add(remainder)) {
- player.drop(remainder, false);
+ player.drop(remainder, false, net.minecraft.util.Prediction.SERVER_ONLY);
}
}
}
--- a/Common/src/main/java/mezz/jei/common/util/ServerCommandUtil.java
+++ b/Common/src/main/java/mezz/jei/common/util/ServerCommandUtil.java
@@ -166,7 +166,7 @@
boolean flag = entityplayermp.getInventory().add(itemStack);
if (flag && itemStack.isEmpty()) {
itemStack.setCount(1);
- ItemEntity entityitem = entityplayermp.drop(itemStack, false);
+ ItemEntity entityitem = entityplayermp.drop(itemStack, false, net.minecraft.util.Prediction.SERVER_ONLY);
if (entityitem != null) {
entityitem.makeFakeItem();
}
@@ -174,7 +174,7 @@
entityplayermp.level().playSound(null, entityplayermp.getX(), entityplayermp.getY(), entityplayermp.getZ(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, 0.2F, ((entityplayermp.getRandom().nextFloat() - entityplayermp.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F);
entityplayermp.inventoryMenu.broadcastChanges();
} else {
- ItemEntity entityitem = entityplayermp.drop(itemStack, false);
+ ItemEntity entityitem = entityplayermp.drop(itemStack, false, net.minecraft.util.Prediction.SERVER_ONLY);
if (entityitem != null) {
entityitem.setNoPickUpDelay();
entityitem.setTarget(entityplayermp.getUUID());
--- a/Common/src/main/resources/assets/jei/lang/en_us.json
+++ b/Common/src/main/resources/assets/jei/lang/en_us.json
@@ -1,5 +1,6 @@
{
- "_comment": "Tooltips",
+ "jei.tooltip.bookmarks": "Bookmarks",
+ "_comment": "Debug (for a debug mode, do not need translation)",
"jei.tooltip.config": "JEI Config",
"jei.tooltip.show.recipes": "Show all recipes",
"jei.tooltip.show.all.recipes.hotkey": "%s to show all recipes.",
@@ -20,22 +21,22 @@
"jei.tooltip.cheat.mode.how.to.disable.hover.config.button.hotkey": "Press \"%s\" here to toggle it.",
"jei.tooltip.recipe.by": "Recipe By: %s",
"jei.tooltip.recipe.id": "Recipe ID: %s",
- "jei.tooltip.not.enough.space": "The area on the right-hand side of this screen is too small for the JEI ingredient list overlay to display.",
- "jei.tooltip.ingredient.list.disabled": "JEI overlays are hidden.",
+ "jei.tooltip.not.enough.space": "The area on the right-hand side of this screen is too small for the ingredient list overlay to display.",
+ "jei.tooltip.ingredient.list.disabled": "Catalogue overlays are hidden.",
"jei.tooltip.ingredient.list.disabled.how.to.fix": "Press \"%s\" to show them again.",
- "jei.tooltip.bookmarks.enable": "Show JEI Bookmarks",
- "jei.tooltip.bookmarks.disable": "Hide JEI Bookmarks",
- "jei.tooltip.bookmarks.usage.nokey": "Add a key binding for JEI bookmarks in your Controls settings.",
+ "jei.tooltip.bookmarks.enable": "Show Bookmarks",
+ "jei.tooltip.bookmarks.disable": "Hide Bookmarks",
+ "jei.tooltip.bookmarks.usage.nokey": "Add a key binding for bookmarks in your Controls settings.",
"jei.tooltip.bookmarks.usage.key": "Hover over an ingredient and press \"%s\" to bookmark it.",
- "jei.tooltip.bookmarks.not.enough.space": "The area on the left-hand side of this screen is too small for the JEI bookmark list overlay to display.",
+ "jei.tooltip.bookmarks.not.enough.space": "The area on the left-hand side of this screen is too small for the bookmark list overlay to display.",
"jei.tooltip.bookmarks.recipe.add": "Bookmark this recipe.",
"jei.tooltip.bookmarks.recipe.remove": "Remove the bookmark for this recipe.",
"jei.tooltip.bookmarks.tooltips.usage": "[Hold \"%s\" for recipe details]",
"jei.tooltip.bookmarks.tooltips.transfer.usage": "[Press \"%s\" to craft one]",
"jei.tooltip.bookmarks.tooltips.transfer.max.usage": "[Press \"%s\" to craft many]",
"jei.tooltip.bookmarks.preview.pin.usage": "[Hold \"%s\" to pin this preview, then click an ingredient to view recipes]",
- "jei.tooltip.lookupHistory.enable": "Show JEI Lookup History",
- "jei.tooltip.lookupHistory.disable": "Hide JEI Lookup History",
+ "jei.tooltip.lookupHistory.enable": "Show Lookup History",
+ "jei.tooltip.lookupHistory.disable": "Hide Lookup History",
"jei.tooltip.lookupHistory.usage": "Shows a list of the ingredients recently used for looking up recipes.",
"jei.tooltip.recipe.tooltips.craft.ingredients": "Ingredients summary:",
"jei.tooltip.recipe.sort.bookmarks.first.enabled": "Show bookmarked recipes first (enabled).",
@@ -44,31 +45,25 @@
"jei.tooltip.recipe.sort.craftable.first.disabled": "Show craftable recipes first (disabled).",
"jei.config.client.appearance.toastReflowEnabled": "Toast Reflow",
"jei.config.client.appearance.toastReflowEnabled.description": "Reserves space for toast notifications so they do not overlap the JEI interface.",
-
- "_comment": "Error Tooltips",
"jei.tooltip.error.recipe.transfer.missing": "Missing Items",
"jei.tooltip.error.recipe.transfer.inventory.full": "Inventory is too full.",
"jei.tooltip.error.recipe.transfer.no.server": "The server must have JEI installed.",
"jei.tooltip.error.recipe.transfer.too.large.player.inventory": "Recipe is too large to craft in the 2x2 player crafting grid.",
"jei.tooltip.error.crash": "This ingredient crashed when getting its tooltip. Please see the client logs for details.",
"jei.tooltip.error.render.crash": "This ingredient crashed when being rendered. Please see the client logs for details.",
-
- "_comment": "Error Messages",
"jei.chat.error.no.cheat.permission.1": "You do not have permission to use JEI's cheat mode.",
"jei.chat.error.no.cheat.permission.disabled": "On this server, it is disabled for all players.",
"jei.chat.error.no.cheat.permission.enabled": "On this server, only the following types of players can use it:",
"jei.chat.error.no.cheat.permission.creative": "players who are in the creative mode",
"jei.chat.error.no.cheat.permission.op": "players who have an operator status (/op)",
"jei.chat.error.no.cheat.permission.give": "players who can use the \"/give\" command",
- "_comment": "Key Bindings",
- "key.category.jei.overlays": "JEI (Overlays)",
- "key.jei.toggleOverlay": "Show/Hide JEI Overlays",
+ "key.category.jei.overlays": "Catalogue",
+ "key.jei.toggleOverlay": "Show/Hide Catalogue",
"key.jei.focusSearch": "Select Search Bar",
"key.jei.previousPage": "Previous Page",
"key.jei.nextPage": "Next Page",
"key.jei.toggleBookmarkOverlay": "Show/Hide Bookmarked Ingredients",
-
- "key.category.jei.recipe.gui": "JEI (Recipes)",
+ "key.category.jei.recipe.gui": "Recipes",
"key.jei.recipeBack": "Previous Recipe",
"key.jei.recipeForward": "Next Recipe",
"key.jei.previousCategory": "Previous Recipe Category",
@@ -77,23 +72,19 @@
"key.jei.nextRecipePage": "Next Recipe Page",
"key.jei.pauseRecipeCycling": "Pause Recipe Ingredient Cycling",
"key.jei.closeRecipeGui": "Close Recipes GUI",
-
- "key.category.jei.cheat.mode": "JEI (Cheat Mode)",
+ "key.category.jei.cheat.mode": "Operator tools",
"key.jei.toggleCheatMode": "Toggle Cheat Mode",
"key.jei.cheatOneItem": "Cheat 1 Item",
"key.jei.cheatOneItem2": "Cheat 1 Item",
"key.jei.cheatItemStack": "Cheat 1 Stack",
"key.jei.cheatItemStack2": "Cheat 1 Stack",
-
- "key.category.jei.hover.config.button": "JEI (Hovering With Mouse Over Config Button)",
+ "key.category.jei.hover.config.button": "Configuration shortcuts",
"key.jei.toggleCheatModeConfigButton": "Toggle Cheat Mode",
-
- "key.category.jei.edit.mode": "JEI (Edit Mode)",
+ "key.category.jei.edit.mode": "Catalogue editing",
"key.jei.toggleEditMode": "Toggle Hide Ingredients Mode",
"key.jei.toggleHideIngredient": "Hide Ingredient",
"key.jei.toggleWildcardHideIngredient": "Hide Ingredient (With Wildcard)",
-
- "key.category.jei.mouse.hover": "JEI (Hovering With Mouse)",
+ "key.category.jei.mouse.hover": "Recipe shortcuts",
"key.jei.bookmark": "Add/Remove Bookmark",
"key.jei.showRecipe": "Show Recipe",
"key.jei.showRecipe2": "Show Recipe",
@@ -103,22 +94,17 @@
"key.jei.maxTransferRecipeBookmark": "Craft Bookmarked Recipe (Many)",
"key.jei.quickMove": "Quick Move Ghost Item",
"key.jei.shareToChat": "Share Item to Chat",
-
- "key.category.jei.search": "JEI (Search Filter)",
+ "key.category.jei.search": "Catalogue search",
"key.jei.clearSearchBar": "Clear Search Filter",
"key.jei.previousSearch": "Previous Search",
"key.jei.nextSearch": "Next Search",
-
- "key.category.jei.dev.tools": "JEI (Dev Tools)",
+ "key.category.jei.dev.tools": "Developer tools",
"key.jei.copy.recipe.id": "Copy Recipe ID to Clipboard",
-
- "_comment": "Config",
"jei.config": "JEI Config",
"jei.config.name": "Name: %s",
"jei.config.description": "Description: %s",
"jei.config.valueValues": "Valid Values: %s",
"jei.config.defaultValue": "Default Value: %s",
-
"jei.config.title": "%MODNAME Config",
"jei.config.default": "Default",
"jei.config.valid": "Valid",
@@ -134,14 +120,12 @@
"jei.config.interface.overlayEnabled.description": "Show the ingredient list overlay next to open GUIs.",
"jei.config.interface.bookmarkOverlayEnabled": "Show Bookmark List Overlay",
"jei.config.interface.bookmarkOverlayEnabled.description": "Show the bookmark list overlay next to open GUIs.",
-
"jei.config.client.appearance": "Appearance",
"jei.config.client.appearance.description": "Config options to change the appearance of JEI.",
"jei.config.client.appearance.centerSearch": "Center Search Bar",
"jei.config.client.appearance.centerSearch.description": "Move the JEI search bar to the bottom center of the screen.",
"jei.config.client.appearance.recipeGuiHeight": "Recipe GUI Height",
"jei.config.client.appearance.recipeGuiHeight.description": "The maximum height for the Recipes Gui (in pixels).",
-
"jei.config.client.cheating": "Cheating",
"jei.config.client.cheating.description": "Config options related to Cheating.",
"jei.config.client.cheating.giveMode": "Give Mode",
@@ -152,7 +136,6 @@
"jei.config.client.cheating.showHiddenIngredients.description": "Enable showing ingredients that are not in the creative menu.",
"jei.config.client.cheating.showTagRecipesEnabled": "Show Tag Recipes",
"jei.config.client.cheating.showTagRecipesEnabled.description": "Show recipes for ingredient tags like item tags and block tags.",
-
"jei.config.client.bookmarks": "Bookmarks",
"jei.config.client.bookmarks.description": "Config options related to Bookmarking ingredients and recipes.",
"jei.config.client.bookmarks.addBookmarksToFrontEnabled": "Add Bookmarks to Front",
@@ -161,7 +144,6 @@
"jei.config.client.bookmarks.bookmarkOutputAsRecipe.description": "When true, pressing the bookmark key on a recipe's output will bookmark the recipe instead of the ingredient.",
"jei.config.client.bookmarks.dragToRearrangeBookmarksEnabled": "Drag To Rearrange Bookmarks",
"jei.config.client.bookmarks.dragToRearrangeBookmarksEnabled.description": "Enable dragging bookmarks to rearrange them in the list.",
-
"jei.config.client.tooltips": "Tooltips",
"jei.config.client.tooltips.description": "Config options related to Tooltips in JEI.",
"jei.config.client.tooltips.bookmarkTooltipFeatures": "Bookmarks Tooltips Features",
@@ -176,14 +158,12 @@
"jei.config.client.tooltips.hideSingleTagContentTooltipEnabled.description": "Hide tag content in tooltips when there is only one ingredient in the tag.",
"jei.config.client.tooltips.enableRecipesGuiIngredientsSummary": "Recipe Ingredient Summary",
"jei.config.client.tooltips.enableRecipesGuiIngredientsSummary.description": "Show a summary of ingredients needed for a recipe, on its output ingredient's tooltip.",
-
"jei.config.client.lookups": "Lookups",
"jei.config.client.lookups.description": "Config options related to looking up uses and recipes for ingredients in JEI.",
"jei.config.client.lookups.lookupFluidContentsEnabled": "Lookup Fluid Contents",
"jei.config.client.lookups.lookupFluidContentsEnabled.description": "When looking up recipes with items that contain fluids, also look up recipes for the fluids.",
"jei.config.client.lookups.lookupBlockTagsEnabled": "Lookup ItemBlock Tags",
"jei.config.client.lookups.lookupBlockTagsEnabled.description": "When searching for item tags, also include tags for the default blocks contained in the items.",
-
"jei.config.client.lookupHistory": "Lookup History",
"jei.config.client.lookupHistory.description": "Config options for showing a history of ingredient lookups in JEI",
"jei.config.client.lookupHistory.enabled": "Enabled",
@@ -194,7 +174,6 @@
"jei.config.client.lookupHistory.maxIngredients.description": "Max number of lookup history ingredients to save.",
"jei.config.client.lookupHistory.displaySide": "Display Side",
"jei.config.client.lookupHistory.displaySide.description": "Side of the screen to display the lookup history overlay.",
-
"jei.config.client.input": "Input",
"jei.config.client.input.description": "Config options related to Inputs in JEI.",
"jei.config.client.input.dragDelayInMilliseconds": "Drag Delay",
@@ -203,26 +182,22 @@
"jei.config.client.input.smoothScrollRate.description": "Scroll rate for scrolling the mouse wheel in smooth-scrolling scroll boxes. Measured in pixels.",
"jei.config.client.input.recipeSlotCyclingEnabled": "Recipe Slot Cycling",
"jei.config.client.input.recipeSlotCyclingEnabled.description": "Automatically cycle through ingredients in recipe slots over time.",
-
"jei.config.client.performance": "Performance",
"jei.config.client.performance.description": "Config options related to performance optimizations in JEI.",
"jei.config.client.performance.lowMemorySlowSearchEnabled": "Low Memory Search",
"jei.config.client.performance.lowMemorySlowSearchEnabled.description": "Set search to low-memory mode (makes search slow but uses less RAM).",
-
"jei.config.client.advanced": "Advanced",
"jei.config.client.advanced.description": "Advanced config options to change the way JEI functions.",
"jei.config.client.advanced.catchRenderErrorsEnabled": "Catch Render Errors",
"jei.config.client.advanced.catchRenderErrorsEnabled.description": "Catch render errors from modded ingredients and attempt to recover from them instead of crashing.",
"jei.config.client.advanced.recipeSyncWarningEnabled": "Recipe Sync Warning",
"jei.config.client.advanced.recipeSyncWarningEnabled.description": "Show a chat warning when the server doesn't provide synced recipes to JEI (e.g. vanilla servers, or servers without JEI installed).",
-
"jei.config.client.sorting": "Sorting",
"jei.config.client.sorting.description": "Config options related to how JEI sorts recipes and ingredients.",
"jei.config.client.sorting.ingredientSortStages": "Ingredient Sorting Stages",
"jei.config.client.sorting.ingredientSortStages.description": "Sorting order for the ingredient list.",
"jei.config.client.sorting.recipeSorterStages": "Recipe Sorting Stages",
"jei.config.client.sorting.recipeSorterStages.description": "Sorting order for displayed recipes.",
-
"jei.config.client.search": "Search",
"jei.config.client.search.description": "Config options related to how JEI searches recipes.",
"jei.config.client.search.modNameSearchMode": "@Mod Name Search Mode",
@@ -247,7 +222,6 @@
"jei.config.client.search.searchShortModNames.description": "Search by the shorthand first letters of a mod's name.",
"jei.config.client.search.searchIngredientAliases": "Search Ingredient Aliases",
"jei.config.client.search.searchIngredientAliases.description": "Search ingredient aliases (alternative names) that are added by plugins, in addition to ingredient names.",
-
"jei.config.client.ingredientList": "Ingredient List",
"jei.config.client.ingredientList.description": "Config options related to the Ingredient List (the list of ingredients on the right side of the screen)",
"jei.config.client.ingredientList.maxRows": "Max Rows",
@@ -266,7 +240,6 @@
"jei.config.client.ingredientList.layoutMode.description": "RECTANGULAR keeps page navigation aligned to the ingredient grid while still allowing excluded grid slots to be cut out. MAXIMIZE_AVAILABLE_SPACE can resize and shift page navigation around excluded areas.",
"jei.config.client.ingredientList.navigationMode": "Navigation Mode",
"jei.config.client.ingredientList.navigationMode.description": "Choose PAGED for page buttons, SCROLLING for a row-stepped scroll bar, or SMOOTH_SCROLLING for a smooth scroll bar.",
-
"jei.config.client.bookmarkList": "Bookmark List",
"jei.config.client.bookmarkList.description": "Config options related to the Bookmark List (the list of bookmarked ingredients on the left side of the screen)",
"jei.config.client.bookmarkList.maxRows": "Max Rows",
@@ -285,17 +258,14 @@
"jei.config.client.bookmarkList.layoutMode.description": "RECTANGULAR keeps page navigation aligned to the bookmark grid while still allowing excluded grid slots to be cut out. MAXIMIZE_AVAILABLE_SPACE can resize and shift page navigation around excluded areas.",
"jei.config.client.bookmarkList.navigationMode": "Navigation Mode",
"jei.config.client.bookmarkList.navigationMode.description": "Choose PAGED for page buttons, SCROLLING for a row-stepped scroll bar, or SMOOTH_SCROLLING for a smooth scroll bar.",
-
"jei.config.client.advanced.itemBlacklist": "Ingredient Blacklist",
"jei.config.client.advanced.itemBlacklist.description": "List of ingredients that should not be displayed in the ingredient list overlay. Format: modId[:name[:meta]]. The hide ingredients mode will automatically add or remove entries here.",
"jei.config.client.advanced.maxColumns": "Max Overlay Width",
"jei.config.client.advanced.maxColumns.description": "The maximum width of the ingredient and bookmark list overlays.",
-
"jei.config.modIdFormat.modName": "Mod Name",
"jei.config.modIdFormat.modName.description": "Config options related to displaying Mod Names",
"jei.config.modIdFormat.modName.modNameFormat": "Mod Name Format",
"jei.config.modIdFormat.modName.modNameFormat.description": "Formatting for the mod names in tooltips for JEI GUIs. Leave blank to disable.",
-
"jei.config.debug.debug": "Debug",
"jei.config.debug.debug.description": "Config options to help developers debug issues in JEI",
"jei.config.debug.debug.debugIngredientsEnabled": "Debug Ingredients",
@@ -308,21 +278,14 @@
"jei.config.debug.debug.debugInfoTooltipsEnabled.description": "Add debug information to ingredient tooltips when advanced tooltips are enabled.",
"jei.config.debug.debug.logSuffixTreeStats": "Log Search Tree Statistics",
"jei.config.debug.debug.logSuffixTreeStats.description": "Log information about the suffix trees used for searching, to help debug JEI.",
-
"jei.config.colors.colors": "Colors",
"jei.config.colors.colors.description": "Config options related to searching for colors of items in JEI",
"jei.config.colors.colors.searchColors": "Search Colors",
"jei.config.colors.colors.searchColors.description": "Color values to search for.",
-
- "_comment": "GUI",
"gui.jei.search": "Ingredient Filter",
-
- "_comment": "Hide Ingredients Mode",
"gui.jei.editMode.description": "JEI Hide Ingredients Mode:",
"gui.jei.editMode.description.hide": "Press \"%s\" to hide.",
"gui.jei.editMode.description.hide.wild": "Press \"%s\" to hide by wildcard.",
-
- "_comment": "Recipe Categories",
"gui.jei.category.craftingTable": "Crafting",
"gui.jei.category.stoneCutter": "Stonecutting",
"gui.jei.category.smelting": "Smelting",
@@ -348,8 +311,6 @@
"gui.jei.category.tagInformation.fluid": "Fluid Tags",
"gui.jei.category.tagInformation.item": "Item Tags",
"gui.jei.category.recipe.crashed": "This recipe crashed. Please see the client logs for details.",
-
- "_comment": "Messages",
"jei.message.configured": "Install the \"Configured\" mod to access the in-game config",
"jei.message.config.folder": "Or click here to open the JEI config folder instead",
"jei.message.copy.recipe.id.success": "The following recipe ID was copied to the clipboard: %s",
@@ -359,8 +320,6 @@
"jei.message.server.recipe.sync.vanilla": "This is a vanilla server. JEI is showing default recipes from your client, which may be different if the server uses datapacks. Install NeoForge or Fabric on the server, along with JEI, to show the server's recipes correctly.",
"jei.message.server.recipe.sync.unavailable": "This %s server does not provide recipes to JEI. JEI is showing default recipes from your client, which may be different on the server.",
"jei.message.server.recipe.sync.jei.missing": "This %s server does not have JEI installed. JEI is showing default recipes from your client, which may be different on the server. Install JEI on the server to show the server's recipes correctly.",
-
- "_comment": "Key Names",
"jei.key.combo.shift": "SHIFT + %s",
"jei.key.combo.control": "CTRL + %s",
"jei.key.combo.command": "CMD + %s",
@@ -368,8 +327,6 @@
"jei.key.shift": "SHIFT",
"jei.key.mouse.left": "CLICK",
"jei.key.mouse.right": "RIGHT-CLICK",
-
- "_comment": "Debug (for a debug mode, do not need translation)",
"description.jei.wooden.door.1": "Wooden doors allow you to block monsters from entering your building.\\nTesting sentences.",
"description.jei.wooden.door.2": "Clicking on a door changes its state from open to closed and vice versa.",
"description.jei.wooden.door.3": "Wooden doors can be opened/closed via redstone circuits.",
@@ -377,5 +334,7 @@
"description.jei.debug.formatting.2": "Testing %s %s formatting replacements.",
"description.jei.debug.formatting.3": "%s nested",
"jei.alias.panda.spawn.egg": "endangered",
- "jei.alias.villager.spawn.egg": "HMMM"
+ "jei.alias.villager.spawn.egg": "HMMM",
+ "jei.tooltip.contextual_fuel": "This item can fuel a furnace. Its burn duration depends on server rules and the furnace type.",
+ "jei.tooltip.contextual_compost": "This item can be composted. The number of layers added depends on server rules and the composter level."
}
--- a/Common/src/main/resources/assets/jei/lang/fr_fr.json
+++ b/Common/src/main/resources/assets/jei/lang/fr_fr.json
@@ -1,5 +1,9 @@
{
- "_comment": "Tooltips",
+ "jei.tooltip.lookupHistory.disable": "Masquer lhistorique des recherches",
+ "jei.tooltip.lookupHistory.enable": "Afficher lhistorique des recherches",
+ "jei.tooltip.bookmarks.disable": "Masquer les favoris",
+ "jei.tooltip.bookmarks.enable": "Afficher les favoris",
+ "_comment": "Debug (for a debug mode, do not need translation)",
"jei.tooltip.config": "Configurer JEI",
"jei.tooltip.show.recipes": "Afficher les recettes",
"jei.tooltip.delete.item": "Cliquer pour supprimer",
@@ -15,75 +19,60 @@
"jei.tooltip.recipe.by": "Recette par : %s",
"jei.tooltip.recipe.id": "ID de la recette : %s",
"jei.tooltip.not.enough.space": "Il n'y a pas assez de place pour afficher la liste d'ingrédients.",
- "jei.tooltip.ingredient.list.disabled": "L'overlay JEI a été désactivé.",
+ "jei.tooltip.ingredient.list.disabled": "Le catalogue est masqué.",
"jei.tooltip.ingredient.list.disabled.how.to.fix": "Pressez %s pour l'activer.",
- "jei.tooltip.bookmarks": "Marque-pages JEI",
- "jei.tooltip.bookmarks.usage.nokey": "Ajoutez un raccourci pour les marque-page JEI dans vos paramètres de raccourcis.",
+ "jei.tooltip.bookmarks": "Favoris",
+ "jei.tooltip.bookmarks.usage.nokey": "Ajoutez un raccourci pour les favoris dans les contrôles.",
"jei.tooltip.bookmarks.usage.key": "Survolez un objet avec votre souris et pressez \"%s\" pour l'épingler.",
"jei.tooltip.bookmarks.not.enough.space": "Il n'y a pas assez de place pour afficher les marque-pages ici.",
-
- "_comment": "Error Tooltips",
"jei.tooltip.error.recipe.transfer.missing": "Objets manquants",
"jei.tooltip.error.recipe.transfer.inventory.full": "Inventaire plein",
"jei.tooltip.error.recipe.transfer.no.server": "JEI doit aussi être installé sur le serveur",
"jei.tooltip.error.recipe.transfer.too.large.player.inventory": "Cette recette est trop grande pour être fabriquée dans la grille 2x2 du joueur.",
"jei.tooltip.error.crash": "Erreur d'infobulle, consulter le log",
-
- "_comment": "Error Messages",
"jei.chat.error.no.cheat.permission.1": "Vous n'avez pas l'autorisation d'utiliser le mode triche de JEI.",
"jei.chat.error.no.cheat.permission.disabled": "Sur ce serveur, le mode triche de JEI est désactivé pour tous les joueurs.",
"jei.chat.error.no.cheat.permission.enabled": "Sur ce serveur, les types de joueurs suivants peuvent utiliser le mode triche de JEI:",
"jei.chat.error.no.cheat.permission.creative": "les joueurs qui sont en mode créatif",
"jei.chat.error.no.cheat.permission.op": "les joueurs qui ont le statut d'opérateur (/op)",
"jei.chat.error.no.cheat.permission.give": "les joueurs qui peuvent utiliser /give",
-
- "_comment": "Key Bindings",
- "key.category.jei.overlays": "JEI (Overlays)",
- "key.jei.toggleOverlay": "Afficher/cacher JEI",
+ "key.category.jei.overlays": "Catalogue",
+ "key.jei.toggleOverlay": "Afficher/masquer le catalogue",
"key.jei.focusSearch": "Sélectionner la barre de recherche",
"key.jei.previousPage": "Afficher la page précédente",
"key.jei.nextPage": "Afficher la page suivante",
"key.jei.toggleBookmarkOverlay": "Afficher/cacher les objets épinglés",
-
- "key.category.jei.recipe.gui": "JEI (Recipes)",
+ "key.category.jei.recipe.gui": "Recettes",
"key.jei.recipeBack": "Montrer la recette précédente",
"key.jei.previousCategory": "Afficher la recette précédente",
"key.jei.nextCategory": "Affiàcher la prochaine catégorie de recette",
"key.jei.previousRecipePage": "Page précédente de la recette",
"key.jei.nextRecipePage": "Page suivante de la recette",
"key.jei.closeRecipeGui": "Fermer l'interface utilisateur des recettes",
-
- "key.category.jei.cheat.mode": "JEI (Cheat Mode)",
+ "key.category.jei.cheat.mode": "Outils opérateur",
"key.jei.toggleCheatMode": "Activer/désactiver le Mode triche",
"key.jei.cheatOneItem": "Triche 1 item",
"key.jei.cheatOneItem2": "Triche 1 item",
"key.jei.cheatItemStack": "Triche 1 stack",
"key.jei.cheatItemStack2": "Triche 1 stack",
-
- "key.category.jei.hover.config.button": "JEI (Hovering with Mouse over Config Button)",
+ "key.category.jei.hover.config.button": "Raccourcis de configuration",
"key.jei.toggleCheatModeConfigButton": "Basculer en mode triche",
-
- "key.category.jei.edit.mode": "JEI (Edit Mode)",
+ "key.category.jei.edit.mode": "Édition du catalogue",
"key.jei.toggleEditMode": "Basculer en mode Masquer/Modifier",
"key.jei.toggleHideIngredient": "Masquer l'ingrédient",
"key.jei.toggleWildcardHideIngredient": "Masquer l'ingrédient (joker)",
-
- "key.category.jei.mouse.hover": "JEI (Hovering with Mouse)",
+ "key.category.jei.mouse.hover": "Raccourcis des recettes",
"key.jei.bookmark": "Ajouter/supprimer un objet épinglé",
"key.jei.showRecipe": "Afficher la recette",
"key.jei.showRecipe2": "Afficher la recette",
"key.jei.showUses": "Montrer les utilisations",
"key.jei.showUses2": "Montrer les utilisations",
-
- "key.category.jei.search": "JEI (Search Filter)",
+ "key.category.jei.search": "Recherche du catalogue",
"key.jei.clearSearchBar": "Effacer le filtre de recherche",
"key.jei.previousSearch": "Recherche précédente",
"key.jei.nextSearch": "Recherche suivante",
-
- "key.category.jei.dev.tools": "JEI (Dev Tools)",
+ "key.category.jei.dev.tools": "Outils de développement",
"key.jei.copy.recipe.id": "Copier l'ID de la recette dans le presse-papiers",
-
- "_comment": "Config",
"jei.config": "Configurer JEI",
"jei.config.default": "Défaut",
"jei.config.valid": "Valide",
@@ -131,13 +120,9 @@
"jei.config.client.cheating.giveMode.description": "Choisit si JEI doit placer les objets directement dans l'inventaire ou les accrocher au curseur de la souris.",
"jei.config.client.bookmarks.addBookmarksToFrontEnabled": "Ajouter de nouveaux marque-pages",
"jei.config.client.bookmarks.addBookmarksToFrontEnabled.description": "Si elle est vraie, elle ajoute les nouveaux marque-pages au début de la liste des marque-pages. Si elle est fausse, elle ajoute les nouveaux marque-pages à la fin de la liste des marque-pages.",
-
- "_comment": "Hide Ingredients Mode",
"gui.jei.editMode.description": "JEI Mode édition de la liste d'objets :",
"gui.jei.editMode.description.hide": "Cacher (%s).",
"gui.jei.editMode.description.hide.wild": "Cacher par caractères génériques (%s).",
-
- "_comment": "Recipe Categories",
"gui.jei.category.craftingTable": "Établi",
"gui.jei.category.stoneCutter": "Tailleur de pierre",
"gui.jei.category.smelting": "Fourneau",
@@ -154,20 +139,14 @@
"gui.jei.category.compostable": "Compostable",
"gui.jei.category.compostable.chance": "Chance: %s%%",
"gui.jei.category.itemInformation": "Information",
-
- "_comment": "Messages",
"jei.message.configured": "Installez le mod \"Configured\" pour accéder à la configuration du jeu.",
"jei.message.config.folder": "Cliquez ici pour ouvrir le dossier de configuration de la JEI",
"jei.message.copy.recipe.id.success": "Copie de l'ID de la recette dans le presse-papiers: %s",
"jei.message.copy.recipe.id.failure": "Échec de la copie de l'ID de la recette dans le presse-papiers, l'ID de la recette est inconnu.",
-
- "_comment": "Key Names",
"jei.key.combo.shift": "SHIFT + %s",
"jei.key.combo.control": "CTRL + %s",
"jei.key.combo.command": "CMD + %s",
"jei.key.combo.alt": "ALT + %s",
-
- "_comment": "Debug (for a debug mode, do not need translation)",
"description.jei.wooden.door.1": "Wooden doors allow you to block monsters from entering your building.\\nTesting sentences.",
"description.jei.wooden.door.2": "Clicking on a door changes its state from open to closed and vice versa.",
"description.jei.wooden.door.3": "Wooden doors can be opened/closed via redstone circuits.",
@@ -175,5 +154,7 @@
"description.jei.debug.formatting.2": "Testing %s %s formatting replacements.",
"description.jei.debug.formatting.3": "%s nested",
"jei.alias.panda.spawn.egg": "endangered",
- "jei.alias.villager.spawn.egg": "HMMM"
+ "jei.alias.villager.spawn.egg": "HMMM",
+ "jei.tooltip.contextual_fuel": "Cet objet sert de combustible. Sa durée dépend des règles du serveur et du type de four.",
+ "jei.tooltip.contextual_compost": "Cet objet peut être composté. Le nombre de couches ajouté dépend des règles du serveur et du remplissage du composteur."
}
--- a/Fabric/src/api/java/mezz/jei/api/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-@NullMarked
-package mezz.jei.api;
-
-import org.jspecify.annotations.NullMarked;
--- a/Fabric/src/main/java/mezz/jei/fabric/JustEnoughItemsClient.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/JustEnoughItemsClient.java
@@ -28,7 +28,7 @@
Translator.setLocaleSupplier(new MinecraftLocaleSupplier());
ClientLifecycleHandler clientLifecycleHandler = new ClientLifecycleHandler();
ClientRecipeSynchronizedEvent.EVENT.register((minecraft, synchronizedRecipes) -> {
- RecipeMap recipes = RecipeMap.create(synchronizedRecipes.recipes());
+ RecipeMap recipes = mezz.jei.common.recipes.RecipeMaps.create(synchronizedRecipes.recipes());
clientLifecycleHandler.onRecipesSynchronized(recipes);
});
--- a/Fabric/src/main/java/mezz/jei/fabric/input/AmecsHelper.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/input/AmecsHelper.java
@@ -9,13 +9,13 @@
import mezz.jei.common.input.keys.JeiKeyModifier;
import net.minecraft.client.input.InputQuirks;
import net.minecraft.network.chat.Component;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
import java.util.ArrayList;
import java.util.List;
public class AmecsHelper {
- public static AmecsKeyModifier COMMAND = new AmecsJeiKeyModifier("jei.key.combo.command", null, GLFW.GLFW_KEY_LEFT_SUPER, GLFW.GLFW_KEY_RIGHT_SUPER);
+ public static AmecsKeyModifier COMMAND = new AmecsJeiKeyModifier("jei.key.combo.command", null, InputConstants.KEY_LGUI, InputConstants.KEY_RGUI);
private static boolean keyMappingManagerLayerInitialized = false;
private static boolean modifiersInitialized = false;
--- a/Fabric/src/main/java/mezz/jei/fabric/input/AmecsJeiKeyMappingBuilder.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/input/AmecsJeiKeyMappingBuilder.java
@@ -28,7 +28,7 @@
@Override
public IJeiKeyMappingInternal buildKeyboardKey(int key) {
- var keyMapping = new AmecsKeyMappingWithContext(description, InputConstants.Type.KEYSYM, key, category, combination, context);
+ var keyMapping = new AmecsKeyMappingWithContext(description, InputConstants.Type.KEYBOARD, key, category, combination, context);
return new AmecsJeiKeyMapping(keyMapping);
}
}
--- a/Fabric/src/main/java/mezz/jei/fabric/input/FabricJeiKeyMappingBuilder.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/input/FabricJeiKeyMappingBuilder.java
@@ -7,7 +7,7 @@
import mezz.jei.common.input.keys.JeiKeyConflictContext;
import mezz.jei.common.input.keys.JeiKeyModifier;
import net.minecraft.client.KeyMapping;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
public class FabricJeiKeyMappingBuilder extends AbstractJeiKeyMappingBuilder {
protected final KeyMapping.Category category;
@@ -35,7 +35,7 @@
@Override
protected IJeiKeyMappingInternal buildMouse(int mouseButton) {
if (hasUnsupportedModifier()) {
- return buildKeyboardKey(GLFW.GLFW_KEY_UNKNOWN);
+ return buildKeyboardKey(InputConstants.UNKNOWN.getValue());
}
FabricKeyMapping keyMapping = new FabricKeyMapping(
@@ -51,12 +51,12 @@
@Override
public IJeiKeyMappingInternal buildKeyboardKey(int key) {
if (hasUnsupportedModifier()) {
- key = GLFW.GLFW_KEY_UNKNOWN;
+ key = InputConstants.UNKNOWN.getValue();
}
FabricKeyMapping keyMapping = new FabricKeyMapping(
description,
- InputConstants.Type.KEYSYM,
+ InputConstants.Type.KEYBOARD,
key,
category,
context
--- a/Fabric/src/main/java/mezz/jei/fabric/mixin/AmecsKeyModifiersEarlyInitMixin.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/mixin/AmecsKeyModifiersEarlyInitMixin.java
@@ -12,7 +12,8 @@
* This mixin into AmecsKeyModifiers Early initializer because that
* where AmecsKeyModifiers are usually sealed.
*/
-@Mixin(AmecsKeyModifiersEarlyInit.class)
+@org.spongepowered.asm.mixin.Pseudo
+@Mixin(targets="de.siphalor.amecs.key_modifiers.impl.AmecsKeyModifiersEarlyInit")
public class AmecsKeyModifiersEarlyInitMixin {
@Inject(
--- a/Fabric/src/main/java/mezz/jei/fabric/platform/BrewingHelper.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/platform/BrewingHelper.java
@@ -7,7 +7,7 @@
import mezz.jei.common.recipes.BrewingExtensionHelper;
import mezz.jei.library.util.BrewingRecipeMakerCommon;
import net.minecraft.util.context.ContextMap;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import java.util.ArrayList;
import java.util.List;
@@ -17,7 +17,7 @@
public List<IJeiBrewingRecipe> getBrewingRecipes(
IIngredientManager ingredientManager,
IVanillaRecipeFactory vanillaRecipeFactory,
- PotionBrewing potionBrewing,
+ RecipeMap potionBrewing,
ContextMap contextMap,
BrewingExtensionHelper brewingExtensionHelper
) {
--- a/Fabric/src/main/java/mezz/jei/fabric/platform/IngredientHelper.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/platform/IngredientHelper.java
@@ -5,7 +5,7 @@
import net.minecraft.core.HolderSet;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.block.ComposterBlock;
@@ -15,23 +15,20 @@
public class IngredientHelper implements IPlatformIngredientHelper {
@Override
- public List<Ingredient> getPotionContainers(PotionBrewing potionBrewing) {
- return potionBrewing.containers;
+ public List<Ingredient> getPotionContainers(RecipeMap potionBrewing) {
+ return potionBrewing.byType(net.minecraft.world.item.crafting.RecipeType.BREWING).stream().map(holder -> holder.value().getInput().ingredient()).distinct().toList();
}
@Override
- public Stream<Ingredient> getPotionIngredients(PotionBrewing potionBrewing) {
- return Stream.concat(
- potionBrewing.potionMixes.stream(),
- potionBrewing.containerMixes.stream()
- )
- .map(PotionBrewing.Mix::ingredient);
+ public Stream<Ingredient> getPotionIngredients(RecipeMap potionBrewing) {
+ return potionBrewing.byType(net.minecraft.world.item.crafting.RecipeType.BREWING).stream()
+ .map(holder -> holder.value().getReagent().ingredient()).distinct();
}
@Override
public float getCompostValue(ItemStack itemStack) {
- Item item = itemStack.getItem();
- return ComposterBlock.COMPOSTABLES.getOrDefault(item, 0f);
+ var compost=itemStack.get(net.minecraft.core.component.DataComponents.COMPOSTABLE);
+ return compost!=null&&compost.layers() instanceof net.minecraft.world.level.storage.loot.providers.number.ints.ResolvableInt.Constant constant&&constant.value()==1?1F:0F;
}
@Override
--- a/Fabric/src/main/java/mezz/jei/fabric/platform/ItemStackHelper.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/platform/ItemStackHelper.java
@@ -10,7 +10,6 @@
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.item.enchantment.Enchantment;
-import net.minecraft.world.level.block.entity.FuelValues;
import org.jspecify.annotations.Nullable;
import java.util.List;
@@ -18,8 +17,13 @@
public class ItemStackHelper implements IPlatformItemStackHelper {
@Override
- public int getBurnTime(ItemStack itemStack, RecipeType<?> recipeType, FuelValues fuelValues) {
- return fuelValues.burnDuration(itemStack);
+ public int getBurnTime(ItemStack itemStack, RecipeType<?> recipeType) {
+ var fuel=itemStack.get(net.minecraft.core.component.DataComponents.COOKING_FUEL);
+ if(fuel==null||!(fuel.burnTime() instanceof net.minecraft.world.level.storage.loot.providers.number.ints.ResolvableInt.Constant time)
+ ||!(fuel.speedMultiplier() instanceof net.minecraft.world.level.storage.loot.providers.number.floats.ResolvableFloat.Constant speed))return 0;
+ // The public JEI count is expressed in equivalent normal-furnace ticks.
+ double ticks=time.value()*speed.value()*(recipeType==RecipeType.SMELTING?1:2);
+ return ticks>0&&ticks<=Integer.MAX_VALUE?(int)ticks:0;
}
@Override
--- a/Fabric/src/main/java/mezz/jei/fabric/platform/RenderHelper.java
+++ b/Fabric/src/main/java/mezz/jei/fabric/platform/RenderHelper.java
@@ -1,6 +1,6 @@
package mezz.jei.fabric.platform;
-import com.mojang.blaze3d.pipeline.RenderPipeline;
+import com.mojang.renderpearl.api.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.datafixers.util.Either;
import mezz.jei.common.platform.IPlatformRenderHelper;
@@ -115,7 +115,7 @@
ClientTooltipPositioner positioner
) {
List<ClientTooltipComponent> components = createClientTooltipComponents(elements, font);
- guiGraphics.tooltip(font, components, x, y, positioner, stack.get(DataComponents.TOOLTIP_STYLE));
+ guiGraphics.tooltip(font, components, x, y, positioner, stack.get(DataComponents.TOOLTIP_STYLE), false);
}
private List<ClientTooltipComponent> createClientTooltipComponents(List<Either<FormattedText, TooltipComponent>> elements, Font font) {
--- a/Fabric/src/main/resources/fabric.mod.json
+++ b/Fabric/src/main/resources/fabric.mod.json
@@ -37,11 +37,9 @@
"accessWidener" : "jei.accesswidener",
"depends": {
+ "minecraft": "${minecraftVersion}",
"fabricloader": "${fabricLoaderVersionRange}",
"fabric-api": "${fabricApiVersionRange}",
"java": ">=${modJavaVersion}"
- },
- "suggests": {
- "amecs_key_modifiers": ">=${amecsVersionFabric}"
}
}
--- a/Fabric/src/main/resources/jei.accesswidener
+++ b/Fabric/src/main/resources/jei.accesswidener
@@ -46,15 +46,11 @@
accessible field net/minecraft/world/item/crafting/ShieldDecorationRecipe target Lnet/minecraft/world/item/crafting/Ingredient;
accessible field net/minecraft/world/item/crafting/ShieldDecorationRecipe result Lnet/minecraft/world/item/ItemStackTemplate;
-accessible field net/minecraft/world/item/alchemy/PotionBrewing containers Ljava/util/List;
-accessible field net/minecraft/world/item/alchemy/PotionBrewing potionMixes Ljava/util/List;
-accessible field net/minecraft/world/item/alchemy/PotionBrewing containerMixes Ljava/util/List;
-accessible method net/minecraft/world/item/alchemy/PotionBrewing$Mix ingredient ()Lnet/minecraft/world/item/crafting/Ingredient;
accessible method net/minecraft/client/gui/GuiGraphicsExtractor setTooltipForNextFrameInternal (Lnet/minecraft/client/gui/Font;Ljava/util/List;IILnet/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipPositioner;Lnet/minecraft/resources/Identifier;Z)V
-accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitSprite (Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIII)V
-accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitNineSlicedSprite (Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;IIIII)V
-accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitTiledSprite (Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V
+accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitSprite (Lcom/mojang/renderpearl/api/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIII)V
+accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitNineSlicedSprite (Lcom/mojang/renderpearl/api/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/client/resources/metadata/gui/GuiSpriteScaling$NineSlice;IIIII)V
+accessible method net/minecraft/client/gui/GuiGraphicsExtractor blitTiledSprite (Lcom/mojang/renderpearl/api/pipeline/RenderPipeline;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;IIIIIIIIIII)V
accessible method net/minecraft/world/inventory/GrindstoneMenu computeResult (Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/item/ItemStack;
--- a/Gui/src/main/java/mezz/jei/gui/bookmarks/IngredientBookmark.java
+++ b/Gui/src/main/java/mezz/jei/gui/bookmarks/IngredientBookmark.java
@@ -35,7 +35,7 @@
@Override
public boolean isVisible() {
- return visible;
+ return visible && mezz.jei.api.sanctuary.CatalogueAccess.allowed.getAsBoolean() && typedIngredient.getIngredient(mezz.jei.api.constants.VanillaTypes.ITEM_STACK).map(mezz.jei.api.sanctuary.CatalogueAccess.ingredient::test).orElse(false);
}
@Override
--- a/Gui/src/main/java/mezz/jei/gui/bookmarks/RecipeBookmark.java
+++ b/Gui/src/main/java/mezz/jei/gui/bookmarks/RecipeBookmark.java
@@ -118,7 +118,7 @@
@Override
public boolean isVisible() {
- return visible;
+ return visible && mezz.jei.api.sanctuary.CatalogueAccess.recipe.test(recipeCategory,recipe);
}
@Override
--- a/Gui/src/main/java/mezz/jei/gui/config/InternalKeyMappings.java
+++ b/Gui/src/main/java/mezz/jei/gui/config/InternalKeyMappings.java
@@ -13,7 +13,7 @@
import mezz.jei.common.platform.Services;
import net.minecraft.client.KeyMapping;
import net.minecraft.resources.Identifier;
-import org.lwjgl.glfw.GLFW;
+import com.mojang.blaze3d.platform.InputConstants;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -116,13 +116,13 @@
toggleOverlay = overlay.createMapping("key.jei.toggleOverlay")
.setContext(JeiKeyConflictContext.GUI)
.setModifier(JeiKeyModifier.CONTROL_OR_COMMAND)
- .buildKeyboardKey(GLFW.GLFW_KEY_O)
+ .buildKeyboardKey(InputConstants.KEY_O)
.register(registerMethod);
focusSearch = overlay.createMapping("key.jei.focusSearch")
.setContext(JeiKeyConflictContext.GUI)
.setModifier(JeiKeyModifier.CONTROL_OR_COMMAND)
- .buildKeyboardKey(GLFW.GLFW_KEY_F)
+ .buildKeyboardKey(InputConstants.KEY_F)
.register(registerMethod);
previousPage = overlay.createMapping("key.jei.previousPage")
@@ -143,12 +143,12 @@
// Mouse Hover
bookmark = mouseHover.createMapping("key.jei.bookmark")
.setContext(JeiKeyConflictContext.JEI_GUI_HOVER)
- .buildKeyboardKey(GLFW.GLFW_KEY_A)
+ .buildKeyboardKey(InputConstants.KEY_A)
.register(registerMethod);
showRecipe1 = mouseHover.createMapping("key.jei.showRecipe")
.setContext(JeiKeyConflictContext.JEI_GUI_HOVER)
- .buildKeyboardKey(GLFW.GLFW_KEY_R)
+ .buildKeyboardKey(InputConstants.KEY_R)
.register(registerMethod);
showRecipe2 = mouseHover.createMapping("key.jei.showRecipe2")
@@ -158,7 +158,7 @@
showUses1 = mouseHover.createMapping("key.jei.showUses")
.setContext(JeiKeyConflictContext.JEI_GUI_HOVER)
- .buildKeyboardKey(GLFW.GLFW_KEY_U)
+ .buildKeyboardKey(InputConstants.KEY_U)
.register(registerMethod);
showUses2 = mouseHover.createMapping("key.jei.showUses2")
@@ -197,12 +197,12 @@
previousSearch = search.createMapping("key.jei.previousSearch")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_UP)
+ .buildKeyboardKey(InputConstants.KEY_UP)
.register(registerMethod);
nextSearch = search.createMapping("key.jei.nextSearch")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_DOWN)
+ .buildKeyboardKey(InputConstants.KEY_DOWN)
.register(registerMethod);
// Cheat Mode
@@ -260,7 +260,7 @@
// Recipes
recipeBack = recipeGui.createMapping("key.jei.recipeBack")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_BACKSPACE)
+ .buildKeyboardKey(InputConstants.KEY_BACKSPACE)
.register(registerMethod);
recipeForward = recipeGui.createMapping("key.jei.recipeForward")
@@ -270,34 +270,34 @@
previousRecipePage = recipeGui.createMapping("key.jei.previousRecipePage")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_PAGE_UP)
+ .buildKeyboardKey(InputConstants.KEY_PAGEUP)
.register(registerMethod);
nextRecipePage = recipeGui.createMapping("key.jei.nextRecipePage")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_PAGE_DOWN)
+ .buildKeyboardKey(InputConstants.KEY_PAGEDOWN)
.register(registerMethod);
pauseRecipeCycling = recipeGui.createMapping("key.jei.pauseRecipeCycling")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_LEFT_SHIFT)
+ .buildKeyboardKey(InputConstants.KEY_LSHIFT)
.register(registerMethod);
previousCategory = recipeGui.createMapping("key.jei.previousCategory")
.setContext(JeiKeyConflictContext.GUI)
.setModifier(JeiKeyModifier.SHIFT)
- .buildKeyboardKey(GLFW.GLFW_KEY_PAGE_UP)
+ .buildKeyboardKey(InputConstants.KEY_PAGEUP)
.register(registerMethod);
nextCategory = recipeGui.createMapping("key.jei.nextCategory")
.setContext(JeiKeyConflictContext.GUI)
.setModifier(JeiKeyModifier.SHIFT)
- .buildKeyboardKey(GLFW.GLFW_KEY_PAGE_DOWN)
+ .buildKeyboardKey(InputConstants.KEY_PAGEDOWN)
.register(registerMethod);
closeRecipeGui = recipeGui.createMapping("key.jei.closeRecipeGui")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_ESCAPE)
+ .buildKeyboardKey(InputConstants.KEY_ESCAPE)
.register(registerMethod);
// Dev Tools
@@ -316,7 +316,7 @@
escapeKey = jeiHidden.createMapping("key.jei.internal.escape.key")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_ESCAPE);
+ .buildKeyboardKey(InputConstants.KEY_ESCAPE);
leftClick = jeiHidden.createMapping("key.jei.internal.left.click")
.setContext(JeiKeyConflictContext.GUI)
@@ -329,11 +329,11 @@
enterKey = new JeiMultiKeyMapping(
jeiHidden.createMapping("key.jei.internal.enter.key")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_ENTER),
+ .buildKeyboardKey(InputConstants.KEY_RETURN),
jeiHidden.createMapping("key.jei.internal.enter.key2")
.setContext(JeiKeyConflictContext.GUI)
- .buildKeyboardKey(GLFW.GLFW_KEY_KP_ENTER)
+ .buildKeyboardKey(InputConstants.KEY_NUMPADENTER)
);
}
--- a/Gui/src/main/java/mezz/jei/gui/overlay/IngredientListOverlay.java
+++ b/Gui/src/main/java/mezz/jei/gui/overlay/IngredientListOverlay.java
@@ -95,7 +95,7 @@
@Override
public boolean isListDisplayed() {
updateScreenPropertiesIfDirty();
- return this.controller.isListDisplayed();
+ return mezz.jei.api.sanctuary.CatalogueAccess.allowed.getAsBoolean() && this.controller.isListDisplayed();
}
private void markScreenPropertiesDirty() {
@@ -150,7 +150,7 @@
this.contents.drawForeground(minecraft, guiGraphics, mouseX, mouseY, partialTicks);
}
if (this.controller.hasValidScreen()) {
- this.configButton.draw(guiGraphics, mouseX, mouseY, partialTicks);
+ if (mezz.jei.api.sanctuary.CatalogueAccess.configButtonVisible.getAsBoolean()) this.configButton.draw(guiGraphics, mouseX, mouseY, partialTicks);
}
if (this.controller.hasValidScreen() && toggleState.isOverlayEnabled()) {
@@ -164,7 +164,7 @@
this.contents.drawTooltips(minecraft, guiGraphics, mouseX, mouseY);
}
if (this.controller.hasValidScreen()) {
- this.configButton.drawTooltips(guiGraphics, mouseX, mouseY);
+ if (mezz.jei.api.sanctuary.CatalogueAccess.configButtonVisible.getAsBoolean()) this.configButton.drawTooltips(guiGraphics, mouseX, mouseY);
}
if (this.controller.hasValidScreen() && toggleState.isOverlayEnabled()) {
this.lookupHistoryOverlay.drawTooltips(minecraft, guiGraphics, mouseX, mouseY);
@@ -216,11 +216,11 @@
final IUserInputHandler displayedInputHandler = new CombinedInputHandler(
"IngredientListOverlay",
this.searchField.createInputHandler(),
- this.configButton.createInputHandler(),
+ new ProxyInputHandler(() -> mezz.jei.api.sanctuary.CatalogueAccess.configButtonVisible.getAsBoolean() ? this.configButton.createInputHandler() : NullInputHandler.INSTANCE),
this.contents.createInputHandler()
);
- final IUserInputHandler configButtonInputHandler = this.configButton.createInputHandler();
+ final IUserInputHandler configButtonInputHandler = new ProxyInputHandler(() -> mezz.jei.api.sanctuary.CatalogueAccess.configButtonVisible.getAsBoolean() ? this.configButton.createInputHandler() : NullInputHandler.INSTANCE);
return new ProxyInputHandler(() -> {
if (isListDisplayed()) {
--- a/Gui/src/main/java/mezz/jei/gui/overlay/IngredientListOverlayLayout.java
+++ b/Gui/src/main/java/mezz/jei/gui/overlay/IngredientListOverlayLayout.java
@@ -86,7 +86,7 @@
) {
SearchAndConfigAreas getSearchAndConfigAreas(boolean contentsHasRoom, ImmutableRect2i contentsArea) {
ImmutableRect2i searchAndConfigArea = getSearchAndConfigArea(contentsHasRoom, contentsArea);
- ImmutableRect2i searchArea = searchAndConfigArea.cropRight(BUTTON_SIZE);
+ ImmutableRect2i searchArea = mezz.jei.api.sanctuary.CatalogueAccess.configButtonVisible.getAsBoolean() ? searchAndConfigArea.cropRight(BUTTON_SIZE) : searchAndConfigArea;
ImmutableRect2i configButtonArea = searchAndConfigArea.keepRight(BUTTON_SIZE);
return new SearchAndConfigAreas(searchArea, configButtonArea);
}
--- a/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/LookupHistoryOverlay.java
+++ b/Gui/src/main/java/mezz/jei/gui/overlay/bookmarks/history/LookupHistoryOverlay.java
@@ -98,7 +98,7 @@
public boolean isListDisplayed() {
updateLayoutIfDirty();
- return clientConfig.lookupHistoryEnabled().getValue() &&
+ return mezz.jei.api.sanctuary.CatalogueAccess.allowed.getAsBoolean() && clientConfig.lookupHistoryEnabled().getValue() &&
isDisplayedOnThisSide() &&
contents.hasRoom();
}
--- a/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java
+++ b/Gui/src/main/java/mezz/jei/gui/recipes/RecipesGui.java
@@ -561,6 +561,7 @@
}
private void open() {
+ if (!mezz.jei.api.sanctuary.CatalogueAccess.allowed.getAsBoolean()) return;
if (!isOpen()) {
parentScreen = minecraft.gui.screen();
}
@@ -597,6 +598,8 @@
@Override
public <T> void showRecipes(IRecipeCategory<T> recipeCategory, List<T> recipes, List<IFocus<?>> focuses) {
+ recipes = recipes.stream().filter(r -> mezz.jei.api.sanctuary.CatalogueAccess.recipe.test(recipeCategory,r)).toList();
+ if (recipes.isEmpty()) return;
ErrorUtil.checkNotNull(recipeCategory, "recipeCategory");
ErrorUtil.checkNotEmpty(recipes, "recipes");
IFocusGroup checkedFocuses = focusFactory.createFocusGroup(focuses);
--- a/Library/src/main/java/mezz/jei/library/gui/recipes/RecipeLayoutInputHandler.java
+++ b/Library/src/main/java/mezz/jei/library/gui/recipes/RecipeLayoutInputHandler.java
@@ -77,7 +77,7 @@
return guiEventListener.mouseReleased(relativeMouseX, relativeMouseY, key.getValue());
}
}
- case KEYSYM -> {
+ case KEYBOARD -> {
if (!userInput.isSimulate()) {
return guiEventListener.keyPressed(relativeMouseX, relativeMouseY, key.getValue(), 0, userInput.getModifiers());
}
--- a/Library/src/main/java/mezz/jei/library/helpers/CodecHelper.java
+++ b/Library/src/main/java/mezz/jei/library/helpers/CodecHelper.java
@@ -41,7 +41,7 @@
ResourceKey.codec(Registries.RECIPE),
TupleCodec.of(
ResourceKey.codec(Registries.RECIPE),
- Recipe.CODEC
+ Recipe.DIRECT_CODEC
)
)
.flatXmap(
--- a/Library/src/main/java/mezz/jei/library/plugins/vanilla/VanillaPlugin.java
+++ b/Library/src/main/java/mezz/jei/library/plugins/vanilla/VanillaPlugin.java
@@ -118,7 +118,7 @@
import net.minecraft.world.inventory.SmokerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import net.minecraft.world.item.crafting.BlastingRecipe;
import net.minecraft.world.item.crafting.CampfireCookingRecipe;
import net.minecraft.world.item.crafting.CraftingRecipe;
@@ -224,9 +224,8 @@
interpretationBuilder.setWildcardForSubtypes(true);
});
registration.register(SlotDisplay.TagSlotDisplay.TYPE, (slotDisplay, ignoredContext, interpretationBuilder) -> {
- interpretationBuilder
- .setTagKey(slotDisplay.tag())
- .setWildcardForSubtypes(true);
+ slotDisplay.tag().unwrapKey().ifPresent(interpretationBuilder::setTagKey);
+ interpretationBuilder.setWildcardForSubtypes(true);
});
registration.register(SlotDisplay.AnyFuel.TYPE, (ignoredSlotDisplay1, ignoredContext, interpretationBuilder) -> {
interpretationBuilder
@@ -374,7 +373,15 @@
Minecraft minecraft = Minecraft.getInstance();
ClientLevel level = minecraft.level;
ErrorUtil.checkNotNull(level, "minecraft.level");
- PotionBrewing potionBrewing = level.potionBrewing();
+ // Contextual server expressions do not provide a fixed client-side duration or chance.
+ // Keep their use discoverable without inventing a scalar value for the public JEI APIs.
+ for(var stack:ingredientManager.getAllItemStacks()) {
+ var fuel=stack.get(DataComponents.COOKING_FUEL);
+ if(fuel!=null)registration.addIngredientInfo(stack,VanillaTypes.ITEM_STACK,Component.translatable("jei.tooltip.contextual_fuel"));
+ var compost=stack.get(DataComponents.COMPOSTABLE);
+ if(compost!=null)registration.addIngredientInfo(stack,VanillaTypes.ITEM_STACK,Component.translatable("jei.tooltip.contextual_compost"));
+ }
+ RecipeMap potionBrewing = Internal.getClientSyncedRecipes();
IPlatformBrewingHelper brewingHelper = Services.PLATFORM.getBrewingHelper();
List<IJeiBrewingRecipe> brewingRecipes = brewingHelper.getBrewingRecipes(
ingredientManager,
@@ -392,7 +399,7 @@
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
registration.addRecipeClickArea(CraftingScreen.class, 88, 32, 28, 23, RecipeTypes.CRAFTING);
registration.addRecipeClickArea(CrafterScreen.class, 88, 32, 28, 23, RecipeTypes.CRAFTING);
- registration.addRecipeClickArea(InventoryScreen.class, 137, 29, 10, 13, RecipeTypes.CRAFTING);
+ // Sanctuary uses a resized inventory; R/U and the Blocodex open recipes without a stale hitbox.
registration.addRecipeClickArea(BrewingStandScreen.class, 97, 16, 14, 30, RecipeTypes.BREWING);
registration.addRecipeClickArea(FurnaceScreen.class, 78, 32, 28, 23, RecipeTypes.SMELTING, RecipeTypes.SMELTING_FUEL);
registration.addRecipeClickArea(SmokerScreen.class, 78, 32, 28, 23, RecipeTypes.SMOKING, RecipeTypes.SMOKING_FUEL);
--- a/Library/src/main/java/mezz/jei/library/plugins/vanilla/cooking/FurnaceRecipeTransferInfo.java
+++ b/Library/src/main/java/mezz/jei/library/plugins/vanilla/cooking/FurnaceRecipeTransferInfo.java
@@ -47,7 +47,7 @@
@Override
public List<Slot> getInventorySlots(FurnaceMenu container, Object recipe) {
- return container.slots.subList(3, 39);
+ return mezz.jei.api.sanctuary.CatalogueAccess.inventory.apply(container, container.slots.subList(3, 39));
}
private static boolean hasSpecificFuel(Object recipe) {
--- a/Library/src/main/java/mezz/jei/library/plugins/vanilla/cooking/fuel/FuelRecipeMaker.java
+++ b/Library/src/main/java/mezz/jei/library/plugins/vanilla/cooking/fuel/FuelRecipeMaker.java
@@ -23,7 +23,7 @@
IPlatformItemStackHelper itemStackHelper = Services.PLATFORM.getItemStackHelper();
return ingredientManager.getAllItemStacks().stream()
.<IJeiFuelingRecipe>mapMulti((stack, consumer) -> {
- int burnTime = itemStackHelper.getBurnTime(stack, recipeType, level.fuelValues());
+ int burnTime = itemStackHelper.getBurnTime(stack, recipeType);
if (burnTime > 0) {
consumer.accept(new FuelingRecipe(List.of(stack), burnTime));
}
--- a/Library/src/main/java/mezz/jei/library/recipes/RecipeManagerInternal.java
+++ b/Library/src/main/java/mezz/jei/library/recipes/RecipeManagerInternal.java
@@ -171,7 +171,7 @@
}
// hide the category if it has crafting stations, but they have all been hidden
- if (hasCraftingStations(recipeType, true) &&
+ if (!mezz.jei.api.sanctuary.CatalogueAccess.blueprints.getAsBoolean() && hasCraftingStations(recipeType, true) &&
!hasCraftingStations(recipeType, false)
) {
return true;
@@ -244,14 +244,15 @@
public <T> Stream<T> getRecipesStream(IRecipeType<T> recipeType, IFocusGroup focuses, boolean includeHidden) {
RecipeTypeData<T> recipeTypeData = this.recipeTypeDataMap.get(recipeType);
- return this.pluginManager.getRecipes(recipeType, recipeTypeData, focuses, includeHidden);
+ return this.pluginManager.getRecipes(recipeType, recipeTypeData, focuses, includeHidden)
+ .filter(recipe -> includeHidden || mezz.jei.api.sanctuary.CatalogueAccess.recipe.test(recipeTypeData.getRecipeCategory(), recipe));
}
public <T> Stream<Consumer<IIngredientAcceptor<?>>> getCraftingStations(IRecipeType<T> recipeType, boolean includeHidden) {
Stream<Consumer<IIngredientAcceptor<?>>> craftingStations = recipeTypeDataMap.get(recipeType)
.getCraftingStations()
.stream();
- if (!includeHidden) {
+ if (!includeHidden && !mezz.jei.api.sanctuary.CatalogueAccess.blueprints.getAsBoolean()) {
craftingStations = craftingStations.filter(craftingStation -> getCraftingStationIngredients(craftingStation, false).findAny().isPresent());
}
return craftingStations;
@@ -262,7 +263,7 @@
boolean includeHidden
) {
Stream<ITypedIngredient<?>> ingredients = resolveCraftingStation(craftingStation);
- if (!includeHidden) {
+ if (!includeHidden && !mezz.jei.api.sanctuary.CatalogueAccess.blueprints.getAsBoolean()) {
ingredients = ingredients.filter(this::isCraftingStationVisible);
}
return ingredients;
--- a/Library/src/main/java/mezz/jei/library/transfer/BasicRecipeTransferInfo.java
+++ b/Library/src/main/java/mezz/jei/library/transfer/BasicRecipeTransferInfo.java
@@ -76,6 +76,6 @@
Slot slot = container.getSlot(i);
slots.add(slot);
}
- return slots;
+ return mezz.jei.api.sanctuary.CatalogueAccess.inventory.apply(container, slots);
}
}
--- a/Library/src/main/java/mezz/jei/library/util/BrewingRecipeMakerCommon.java
+++ b/Library/src/main/java/mezz/jei/library/util/BrewingRecipeMakerCommon.java
@@ -21,7 +21,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.PotionItem;
import net.minecraft.world.item.alchemy.Potion;
-import net.minecraft.world.item.alchemy.PotionBrewing;
+import net.minecraft.world.item.crafting.RecipeMap;
import net.minecraft.world.item.alchemy.PotionContents;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.display.SlotDisplay;
@@ -43,42 +43,28 @@
public static Set<IJeiBrewingRecipe> getVanillaBrewingRecipes(
IVanillaRecipeFactory recipeFactory,
IIngredientManager ingredientManager,
- PotionBrewing potionBrewing,
+ RecipeMap potionBrewing,
ContextMap contextMap
) {
- Set<IJeiBrewingRecipe> recipes = new HashSet<>();
- Registry<Potion> potionRegistry = RegistryUtil.getRegistry(Registries.POTION);
- IIngredientHelper<ItemStack> itemStackHelper = ingredientManager.getIngredientHelper(VanillaTypes.ITEM_STACK);
-
- IngredientSet<ItemStack> knownPotions = getBaseKnownPotions(ingredientManager, potionRegistry, potionBrewing, contextMap);
-
- IPlatformIngredientHelper ingredientHelper = Services.PLATFORM.getIngredientHelper();
- IngredientSet<ItemStack> potionReagents = ingredientHelper.getPotionIngredients(potionBrewing)
- .map(Ingredient::display)
- .flatMap(display -> display.resolve(contextMap, SlotDisplay.ItemStackContentsFactory.INSTANCE))
- .collect(Collectors.toCollection(() -> new IngredientSet<>(itemStackHelper, UidContext.Ingredient)));
-
- boolean foundNewPotions;
- do {
- List<ItemStack> newPotions = getNewPotions(
- potionBrewing,
- recipeFactory,
- itemStackHelper,
- knownPotions,
- potionReagents,
- recipes
- );
- foundNewPotions = !newPotions.isEmpty();
- knownPotions.addAll(newPotions);
- } while (foundNewPotions);
-
- return recipes;
- }
+ Set<IJeiBrewingRecipe> recipes = new HashSet<>();
+ Registry<Potion> potionRegistry = RegistryUtil.getRegistry(Registries.POTION);
+ var knownPotions=getBaseKnownPotions(ingredientManager,potionRegistry,potionBrewing,contextMap);
+ var nativeRecipes=potionBrewing.byType(net.minecraft.world.item.crafting.RecipeType.BREWING);
+ nativeRecipes.forEach(holder -> knownPotions.add(holder.value().getOutput().create()));
+ for(var holder:nativeRecipes) {
+ var recipe=holder.value();
+ var inputs=knownPotions.stream().filter(recipe.getInput()::test).toList();
+ var reagents=recipe.getReagent().ingredient().display().resolve(contextMap,SlotDisplay.ItemStackContentsFactory.INSTANCE)
+ .filter(recipe.getReagent()::test).toList();
+ if(!inputs.isEmpty()&&!reagents.isEmpty())recipes.add(recipeFactory.createBrewingRecipe(reagents,inputs,recipe.getOutput().create(),holder.id().identifier()));
+ }
+ return recipes;
+ }
private static IngredientSet<ItemStack> getBaseKnownPotions(
IIngredientManager ingredientManager,
Registry<Potion> potionRegistry,
- PotionBrewing potionBrewing,
+ RecipeMap potionBrewing,
ContextMap contextMap
) {
IPlatformIngredientHelper ingredientHelper = Services.PLATFORM.getIngredientHelper();
@@ -104,95 +90,4 @@
return knownPotions;
}
- private static List<ItemStack> getNewPotions(
- PotionBrewing potionBrewing,
- IVanillaRecipeFactory recipeFactory,
- IIngredientHelper<ItemStack> itemStackHelper,
- Collection<ItemStack> knownPotions,
- Collection<ItemStack> potionReagents,
- Collection<IJeiBrewingRecipe> recipes
- ) {
- List<ItemStack> newPotions = new ArrayList<>();
- for (ItemStack potionInput : knownPotions) {
- Object inputId = itemStackHelper.getUid(potionInput, UidContext.Recipe);
- String inputPathId = PotionSubtypeInterpreter.INSTANCE.getStringName(potionInput);
-
- for (ItemStack potionReagent : potionReagents) {
- ItemStack potionInputCopy = potionInput.copy();
- ItemStack potionOutput = getOutput(potionBrewing, potionInputCopy, potionReagent);
- if (potionOutput.isEmpty()) {
- continue;
- }
-
- if (potionInput.getItem() instanceof PotionItem && potionOutput.getItem() instanceof PotionItem) {
- Optional<Holder<Potion>> potionOutputType = potionOutput.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).potion();
- if (potionOutputType.isEmpty()) {
- continue;
- }
- }
-
- Object outputId = itemStackHelper.getUid(potionOutput, UidContext.Recipe);
- if (Objects.equals(inputId, outputId)) {
- continue;
- }
-
- Identifier outputResourceLocation = itemStackHelper.getIdentifier(potionOutput);
- String outputPathId = PotionSubtypeInterpreter.INSTANCE.getStringName(potionOutput);
- String outputModId = outputResourceLocation.getNamespace();
- String uidPath = ResourceLocationUtil.sanitizePath(inputPathId + ".to." + outputPathId);
- IJeiBrewingRecipe recipe = recipeFactory.createBrewingRecipe(
- List.of(potionReagent),
- potionInputCopy,
- potionOutput,
- Identifier.fromNamespaceAndPath(outputModId, uidPath)
- );
-
- IJeiBrewingRecipe existingRecipe = recipes.stream()
- .filter(recipe::equals)
- .findFirst()
- .orElse(null);
- if (existingRecipe == null) {
- recipes.add(recipe);
- newPotions.add(potionOutput);
- } else {
- // This is a recipe with the same uid and output as an existing recipe,
- // but it has a different reagent.
- // Create a recipe that combines the two.
- IngredientSet<ItemStack> reagents = new IngredientSet<>(itemStackHelper, UidContext.Recipe);
- reagents.addAll(existingRecipe.getIngredients());
- reagents.add(potionReagent);
- if (reagents.size() != existingRecipe.getIngredients().size()) {
- IJeiBrewingRecipe replacementRecipe = recipeFactory.createBrewingRecipe(
- List.copyOf(reagents),
- existingRecipe.getPotionInputs(),
- existingRecipe.getPotionOutput(),
- existingRecipe.getUid()
- );
- recipes.remove(existingRecipe);
- recipes.add(replacementRecipe);
- }
- }
- }
- }
- return newPotions;
- }
-
- private static ItemStack getOutput(PotionBrewing potionBrewing, ItemStack potion, ItemStack itemStack) {
- try {
- ItemStack result = potionBrewing.mix(itemStack, potion);
- if (result != itemStack) {
- return result;
- }
- } catch (RuntimeException e) {
- String potionInfo = ErrorUtil.getItemStackInfo(potion);
- String itemStackInfo = ErrorUtil.getItemStackInfo(itemStack);
- LOGGER.error(
- "A modded potion mix crashed: \nPotion: {}\nItemStack: {}",
- potionInfo,
- itemStackInfo,
- e
- );
- }
- return ItemStack.EMPTY;
- }
}