emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
236 stars 46 forks source link

Spirit's JEI plugin works fine with JEMI in singleplayer, but causes severe graphical issues in multiplayer #379

Closed unilock closed 9 months ago

unilock commented 9 months ago

The mod Spirit adds a few unique recipe categories to JEI, at least one of which renders blocks using the Minecraft client's own BlockRenderDispatcher / BlockRenderManager.

Here's an example of one such recipe, displayed in EMI via JEMI:

image

However, this is the same recipe viewed when connected to a multiplayer / dedicated server:

image

.

In-game, the dark rectangle near the center of the screenshot is the only part of the screen that continues to update normally. Everything outside of the rectangle will rapidly flash between black and what was visible at the time the recipe was first accessed (i.e. what's visible in the screenshot) until the game is exited.

This is the error thrown in the client log on a dedicated server:

[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/java.util.Objects.checkIndex(Objects.java:385)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/java.util.ArrayList.get(ArrayList.java:427)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at me.codexadrian.spirit.compat.jei.multiblock.RotatableList.getCurrent(RotatableList.java:16)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at me.codexadrian.spirit.compat.jei.categories.SoulEngulfingCategory.draw(SoulEngulfingCategory.java:133)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at me.codexadrian.spirit.compat.jei.categories.SoulEngulfingCategory.draw(SoulEngulfingCategory.java:44)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at dev.emi.emi.jemi.JemiRecipe$JemiWidget.method_25394(JemiRecipe.java:157)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at dev.emi.emi.screen.RecipeScreen.method_25394(RecipeScreen.java:225)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at net.minecraft.class_757.method_3192(class_757.java:881)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at net.minecraft.class_310.method_1523(class_310.java:1177)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at net.minecraft.class_310.method_1514(class_310.java:768)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at net.minecraft.client.main.Main.method_44604(Main.java:244)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at net.minecraft.client.main.Main.main(Main.java:51)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.quiltmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:551)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:84)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:87)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.prismlauncher.EntryPoint.listen(EntryPoint.java:125)
[13:19:56] [Render thread/INFO] (Minecraft) [STDERR]:   at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)

This is, I believe, the relevant code in Spirit: https://github.com/terrarium-earth/Spirit/blob/c14173bc2d304250a3a3a964ecc653113e932e9e/common/src/main/java/me/codexadrian/spirit/compat/jei/categories/SoulEngulfingCategory.java#L129-L136

Versions:

emilyploszaj commented 9 months ago

This seems to be a bug in Spirit that you could replicate in JEI, and has nothing to do with EMI. My assumption is they are not serializing their block map properly and it's not getting sent to the client in multiplayer, causing an index out of bounds exception. I believe this bug is the relevant issue on their repo: https://github.com/terrarium-earth/Spirit/issues/61