MoonflowerTeam / pollen

⚙️ Library for all Moonflower mods. Adds bridges for Fabric and Forge using Architectury along with utilities such as our Pinwheel bedrock animation API.
https://www.curseforge.com/minecraft/mc-mods/pollen
Other
32 stars 19 forks source link

[1.18.2] Pollen 1.6.0 breaks a grindstone #70

Closed KiyoGawaKG closed 1 year ago

KiyoGawaKG commented 1 year ago

What version are you seeing the problem on?

1.18.2

Describe the issue

When i want to remove enchantments from any item on the grindstone, I can't do it.

latest.log

[Render thread/ERROR]: Found a broken recipe, failed to setRecipe with RecipeLayoutBuilder: Minecraft minecraft:disenchant_netherite_chestplate class gg.moonflower.pollen.api.crafting.grindstone.PollenShapelessGrindstoneRecipe
unilock commented 1 year ago

I posted a "fix" to moonflower's Discord server yesterday, but haven't yet received a response.

https://github.com/MoonflowerTeam/pollen/blob/1.18.x/common/src/main/java/gg/moonflower/pollen/core/mixin/GrindstoneMenuMixin.java#L65

I changed the != on this line to ==.

That fixed the grindstone itself, but not the JEI integration - JEI's grindstone recipes remain blank.

BetaFoprhoton commented 1 year ago

[12:25:25] [Render thread/ERROR]: Error caught from Recipe Category: pollen:grindstone java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at java.util.Arrays$ArrayList.get(Arrays.java:4165) ~[?:?] at net.minecraft.core.NonNullList.get(NonNullList.java:47) ~[client-1.18.2-20220404.173914-srg.jar%2362!/:?] at gg.moonflower.pollen.core.forge.compat.jei.PollenGrindstoneCategory.setRecipe(PollenGrindstoneCategory.java:81) ~[pollen-forge-1.6.0+1.18.2.jar%2361!/:?] at gg.moonflower.pollen.core.forge.compat.jei.PollenGrindstoneCategory.setRecipe(PollenGrindstoneCategory.java:31) ~[pollen-forge-1.6.0+1.18.2.jar%2361!/:?]

This is a part of the exception. It is ArrayIndexOutOfBoundsException. The index of the ingredients list is out of range. So I think we can replace create() in line 41 of PollenShapelessGrindstoneRecipe.java with createWithCapacity (2). Due to some packaging problems, I can't test this fix, but maybe it can fix jei's blank problemThis is my suggestion.
jacksonhardaway commented 1 year ago

Fixed in 1.6.1