diff --git a/build.gradle b/build.gradle index 8f8f9734..c30db69d 100644 --- a/build.gradle +++ b/build.gradle @@ -133,13 +133,13 @@ dependencies { compileOnly("curse.maven:jade-324717:5109393") // JEI OPTIONAL compileOnly("mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}") - //runtimeOnly("mezz.jei:jei-${mc_version}-neoforge:${jei_version}") + runtimeOnly("mezz.jei:jei-${mc_version}-neoforge:${jei_version}") // REI OPTIONAL todo add compileOnly("me.shedaniel:RoughlyEnoughItems-forge:${rei_version}") compileOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}") // EMI OPTIONAL compileOnly("dev.emi:emi-neoforge:${emi_version}+${mc_version}:api") - runtimeOnly("dev.emi:emi-neoforge:${emi_version}+${mc_version}") + //runtimeOnly("dev.emi:emi-neoforge:${emi_version}+${mc_version}") //implementation("curse.maven:reipc-521393:4837449") // KubeJS OPTIONAL implementation("dev.architectury:architectury-neoforge:${architectury_version}") diff --git a/changelog.md b/changelog.md index 264ce461..71262cdc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +## Ex Deorum 3.4 +- Fix JEI bug with sieve recipes overflowing due to JEI API changes +- Fix invisible output slots on JEI crook recipes + ## Ex Deorum 3.3 - Now built against Minecraft 1.21.1 - Add native EMI support. diff --git a/gradle.properties b/gradle.properties index 1f746a79..69110953 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ neo_version=21.1.51 neo_version_range=[21.1,) loader_version_range=[4,) -jei_version=19.18.3.204 +jei_version=19.19.6.236 rei_version=14.0.688 emi_version=1.1.13 cloth_config_version=15.0.127 diff --git a/src/main/java/thedarkcolour/exdeorum/compat/ClientXeiUtil.java b/src/main/java/thedarkcolour/exdeorum/compat/ClientXeiUtil.java index d5ca3d97..8681d3ca 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/ClientXeiUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/ClientXeiUtil.java @@ -42,11 +42,8 @@ import thedarkcolour.exdeorum.data.TranslationKeys; import thedarkcolour.exdeorum.material.DefaultMaterials; import thedarkcolour.exdeorum.registry.EBlocks; -import java.text.DecimalFormat; - // client-only logic shared between JEI and EMI public class ClientXeiUtil { - public static final DecimalFormat FORMATTER = new DecimalFormat(); private static final ItemStack OAK_BARREL = new ItemStack(DefaultMaterials.OAK_BARREL.getItem()); private static final FluidState EMPTY = Fluids.EMPTY.defaultFluidState(); @@ -94,6 +91,8 @@ public class ClientXeiUtil { public static void renderBlock(GuiGraphics guiGraphics, BlockState state, float x, float y, float z, float scale) { PoseStack poseStack = guiGraphics.pose(); + poseStack.pushPose(); + poseStack.translate(x, y, z); poseStack.scale(-scale, -scale, -scale); poseStack.translate(-0.5F, -0.5F, 0); @@ -102,7 +101,6 @@ public class ClientXeiUtil { poseStack.mulPose(Axis.YP.rotationDegrees(45f)); poseStack.translate(-0.5F, 0, 0.5F); - poseStack.pushPose(); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); poseStack.translate(0, 0, -1); @@ -174,7 +172,7 @@ public class ClientXeiUtil { // Takes a decimal probability and returns a user-friendly percentage value public static Component formatChance(double probability) { - var chance = FORMATTER.format(probability * 100); + var chance = XeiUtil.FORMATTER.format(probability * 100); return Component.translatable(TranslationKeys.SIEVE_RECIPE_CHANCE, chance).withStyle(ChatFormatting.GRAY); } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/XeiUtil.java b/src/main/java/thedarkcolour/exdeorum/compat/XeiUtil.java index 8d2f7c4e..d9a9bc21 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/XeiUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/XeiUtil.java @@ -60,10 +60,6 @@ public class XeiUtil { public static final int BARREL_MIXING_WIDTH = 120; public static final int BARREL_MIXING_HEIGHT = 18; - // Barrel compost - public static final int BARREL_COMPOST_WIDTH = 120; - public static final int BARREL_COMPOST_HEIGHT = 18; - // Block predicate (Crucible Heat, Sieve) public static final Component REQUIRES_CERTAIN_STATE = Component.translatable(TranslationKeys.CROOK_CATEGORY_REQUIRES_STATE).withStyle(ChatFormatting.GRAY); diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java index b7c33520..79d4f3e6 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/SieveCategory.java @@ -33,24 +33,13 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.storage.loot.providers.number.NumberProvider; -import net.neoforged.neoforge.common.util.Lazy; import org.apache.commons.lang3.mutable.MutableInt; -import thedarkcolour.exdeorum.compat.ClientXeiUtil; import thedarkcolour.exdeorum.compat.XeiSieveRecipe; import thedarkcolour.exdeorum.compat.XeiUtil; import thedarkcolour.exdeorum.data.TranslationKeys; import thedarkcolour.exdeorum.material.DefaultMaterials; class SieveCategory implements IRecipeCategory { - public static final int WIDTH = 162; - public static final int ROW_START = 28; - - static { - ClientXeiUtil.FORMATTER.setMinimumFractionDigits(0); - ClientXeiUtil.FORMATTER.setMaximumFractionDigits(3); - } - - private final Lazy background; private final IDrawable slot; private final IDrawable row; private final IDrawable icon; @@ -58,7 +47,6 @@ class SieveCategory implements IRecipeCategory { private final MutableInt rows; SieveCategory(IGuiHelper helper, ItemLike icon, Component title, MutableInt rows) { - this.background = Lazy.of(() -> helper.createBlankDrawable(XeiUtil.SIEVE_WIDTH, XeiUtil.SIEVE_ROW_START + XeiUtil.SIEVE_ROW_HEIGHT * rows.intValue())); this.slot = helper.getSlotDrawable(); this.row = helper.createDrawable(ExDeorumJeiPlugin.EX_DEORUM_JEI_TEXTURE, 0, 0, 162, 18); this.icon = helper.createDrawableItemStack(new ItemStack(icon)); @@ -81,8 +69,13 @@ class SieveCategory implements IRecipeCategory { } @Override - public IDrawable getBackground() { - return this.background.get(); + public int getWidth() { + return XeiUtil.SIEVE_WIDTH; + } + + @Override + public int getHeight() { + return XeiUtil.SIEVE_ROW_START + XeiUtil.SIEVE_ROW_HEIGHT * rows.intValue(); } @Override @@ -97,7 +90,7 @@ class SieveCategory implements IRecipeCategory { for (int i = 0; i < recipe.results().size(); i++) { var result = recipe.results().get(i); - var slot = builder.addSlot(RecipeIngredientRole.OUTPUT, 1 + (i % 9) * 18, 1 + ROW_START + 18 * (i / 9)).addItemStack(result.item); + var slot = builder.addSlot(RecipeIngredientRole.OUTPUT, 1 + (i % 9) * 18, 1 + XeiUtil.SIEVE_ROW_START + 18 * (i / 9)).addItemStack(result.item); addTooltips(slot, result.byHandOnly, result.provider); }