From c2623ec377beb8f7194e9e853995c15d5c297408 Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:37:17 -0700 Subject: [PATCH] Display compressed hammer recipes more accurately --- .../exdeorum/compat/jei/HammerCategory.java | 9 +++++++-- .../exdeorum/material/DefaultMaterials.java | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java index 904c9209..7c8ada41 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/HammerCategory.java @@ -25,6 +25,7 @@ import mezz.jei.api.recipe.RecipeType; import net.minecraft.network.chat.Component; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import thedarkcolour.exdeorum.data.TranslationKeys; import thedarkcolour.exdeorum.recipe.hammer.HammerRecipe; import thedarkcolour.exdeorum.registry.EItems; @@ -52,7 +53,11 @@ class HammerCategory extends OneToOneCategory { @Override protected void addOutput(IRecipeSlotBuilder slot, HammerRecipe recipe) { - slot.addItemStack(new ItemStack(recipe.result)); - SieveCategory.addTooltips(slot, false, recipe.resultAmount); + if (recipe.resultAmount instanceof ConstantValue constant) { + slot.addItemStack(new ItemStack(recipe.result, (int) constant.value)); + } else { + slot.addItemStack(new ItemStack(recipe.result)); + SieveCategory.addTooltips(slot, false, recipe.resultAmount); + } } } diff --git a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java index 16868467..2e392c65 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java +++ b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java @@ -239,6 +239,7 @@ public class DefaultMaterials { public static void registerMaterials() { BARRELS.search(BarrelMaterial::readFromJson); SIEVES.search(SieveMaterial::readFromJson); + // todo compressed sieve JSON LAVA_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, LavaCrucibleMaterial::new)); WATER_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, WaterCrucibleMaterial::new)); }