Fix JEI sieve recipe bug

Close #114
This commit is contained in:
thedarkcolour 2024-09-30 12:23:06 -07:00
parent 21b50ae42c
commit 7bcfd63cf7
No known key found for this signature in database
GPG Key ID: 86B37B3575FD5976
4 changed files with 17 additions and 9 deletions

View File

@ -25,6 +25,7 @@ minecraft {
workingDirectory project.file('run')
jvmArgs.add('-XX:+AllowEnhancedClassRedefinition')
jvmArgs.add('-XX:+IgnoreUnrecognizedVMOptions')
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
@ -41,6 +42,7 @@ minecraft {
workingDirectory project.file('run/server')
jvmArgs.add('-XX:+AllowEnhancedClassRedefinition')
jvmArgs.add('-XX:+IgnoreUnrecognizedVMOptions')
property 'forge.logging.console.level', 'debug'
@ -131,15 +133,15 @@ dependencies {
// JADE OPTIONAL
implementation(fg.deobf("curse.maven:jade-324717:4986594"))
// JEI OPTIONAL
//compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}"))
//implementation(fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}"))
implementation(fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}"))
// REI OPTIONAL
compileOnly(fg.deobf("me.shedaniel:RoughlyEnoughItems-forge:${rei_version}"))
compileOnly(fg.deobf("me.shedaniel.cloth:cloth-config-forge:${cloth_config_version}"))
compileOnly(fg.deobf("curse.maven:reipc-521393:4837449"))
// EMI OPTIONAL
compileOnly(fg.deobf("dev.emi:emi-forge:${emi_version}:api"))
runtimeOnly(fg.deobf("dev.emi:emi-forge:${emi_version}"))
//runtimeOnly(fg.deobf("dev.emi:emi-forge:${emi_version}"))
// KubeJS OPTIONAL
implementation fg.deobf("dev.architectury:architectury-forge:${architectury_version}")
implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")

View File

@ -1,3 +1,6 @@
## Ex Deorum 1.42
- Fix JEI sieve recipe bug
## Ex Deorum 1.41
- Add native EMI support.
- Fix bug where removing all Compressed Sieve recipes would break regular Sieve recipe display in JEI.

View File

@ -27,7 +27,7 @@ import thedarkcolour.exdeorum.material.DefaultMaterials;
class CompressedSieveCategory extends SieveCategory {
CompressedSieveCategory(IGuiHelper helper) {
super(helper, DefaultMaterials.OAK_COMPRESSED_SIEVE, Component.translatable(TranslationKeys.COMPRESSED_SIEVE_CATEGORY_TITLE), XeiSieveRecipe.COMPRESSED_SIEVE_ROWS.intValue());
super(helper, DefaultMaterials.OAK_COMPRESSED_SIEVE, Component.translatable(TranslationKeys.COMPRESSED_SIEVE_CATEGORY_TITLE), XeiSieveRecipe.COMPRESSED_SIEVE_ROWS);
}
@Override

View File

@ -34,6 +34,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.storage.loot.providers.number.NumberProvider;
import net.minecraftforge.common.util.Lazy;
import org.apache.commons.lang3.mutable.MutableInt;
import thedarkcolour.exdeorum.compat.XeiSieveRecipe;
import thedarkcolour.exdeorum.compat.XeiUtil;
import thedarkcolour.exdeorum.data.TranslationKeys;
@ -45,11 +46,11 @@ class SieveCategory implements IRecipeCategory<XeiSieveRecipe> {
private final IDrawable row;
private final IDrawable icon;
private final Component title;
private final int rows;
private final MutableInt rows;
// Common constructor
SieveCategory(IGuiHelper helper, ItemLike icon, Component title, int rows) {
this.background = Lazy.of(() -> helper.createBlankDrawable(XeiUtil.SIEVE_WIDTH, XeiUtil.SIEVE_ROW_START + XeiUtil.SIEVE_ROW_HEIGHT * 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));
@ -59,7 +60,7 @@ class SieveCategory implements IRecipeCategory<XeiSieveRecipe> {
// Regular sieve
SieveCategory(IGuiHelper helper) {
this(helper, DefaultMaterials.OAK_SIEVE, Component.translatable(TranslationKeys.SIEVE_CATEGORY_TITLE), XeiSieveRecipe.SIEVE_ROWS.intValue());
this(helper, DefaultMaterials.OAK_SIEVE, Component.translatable(TranslationKeys.SIEVE_CATEGORY_TITLE), XeiSieveRecipe.SIEVE_ROWS);
}
@Override
@ -110,7 +111,9 @@ class SieveCategory implements IRecipeCategory<XeiSieveRecipe> {
this.slot.draw(graphics, 58, 0);
this.slot.draw(graphics, 86, 0);
for (int i = 0; i < this.rows; i++) {
int rows = this.rows.intValue();
for (int i = 0; i < rows; i++) {
this.row.draw(graphics, 0, 28 + i * 18);
}
}