MinecraftschurliMods / Ars-Magica-Legacy

Port of Mithion's Ars Magica 2 mod for Minecraft 1.18 and above.
https://www.curseforge.com/minecraft/mc-mods/ars-magica-legacy
Other
11 stars 6 forks source link

[Bug]: NoSuchElementException em Spell.java #437

Closed JCsvg closed 2 months ago

JCsvg commented 4 months ago

Describe the bug

Problem description: While playing with the "Ars Magica Legacy" mod, I encountered an error that is causing a NoSuchElementException exception during gameplay. It appears that the error occurs when the game tries to render an entity called "Spell" in the world. After investigating further, I discovered that the problem is located in the mod's Spell class. Error Details: Exception: java.util.NoSuchElementException Error Location: Spell.java, partsWithModifiers method

Steps to Reproduce

Steps to Reproduce:

Start the game with the "Ars Magica Legacy" mod installed. Enter a world where the mod is active. During the game, do: create a spell with the combinations: self -> regeneration and then try to create a spell with the combinations: self -> heal when trying to finish the spell and trying to open the book the game will close

Expected behavior

The game is expected to correctly render "Spell" entities without throwing exceptions.

Screenshots

image image image

Version

1.18.2-1.3.0

Forge Version

40.2.7

Other Mods

crash-2024-02-18_12.54.18-client.txt

Log

Caused by: java.util.NoSuchElementException
    at java.util.LinkedList.getLast(LinkedList.java:261) ~[?:?]
    at com.github.minecraftschurlimods.arsmagicalegacy.common.spell.Spell.lambda$partsWithModifiers$4(Spell.java:191) ~[arsmagicalegacy-1.18.2-1.3.0-SNAPSHOT.jar%2361!/:1.3.0]
    at java.util.Optional.ifPresentOrElse(Optional.java:196) ~[?:?]
    at com.github.minecraftschurlimods.arsmagicalegacy.common.spell.Spell.partsWithModifiers(Spell.java:189) ~[arsmagicalegacy-1.18.2-1.3.0-SNAPSHOT.jar%2361!/:1.3.0]
    at com.github.minecraftschurlimods.arsmagicalegacy.common.spell.Spell.affinityShifts(Spell.java:285) ~[arsmagicalegacy-1.18.2-1.3.0-SNAPSHOT.jar%2361!/:1.3.0]
    at com.github.minecraftschurlimods.arsmagicalegacy.common.spell.Spell.primaryAffinity(Spell.java:310) ~[arsmagicalegacy-1.18.2-1.3.0-SNAPSHOT.jar%2361!/:1.3.0]
    at com.github.minecraftschurlimods.arsmagicalegacy.client.model.item.SpellItemModel$1.m_173464_(SpellItemModel.java:33) ~[arsmagicalegacy-1.18.2-1.3.0-SNAPSHOT.jar%2361!/:1.3.0]
    at net.minecraft.client.renderer.entity.ItemRenderer.m_174264_(ItemRenderer.java:219) ~[client-1.18.2-20220404.173914-srg.jar%23224!/:?]
    at net.minecraft.client.renderer.entity.ItemEntityRenderer.m_7392_(ItemEntityRenderer.java:60) ~[client-1.18.2-20220404.173914-srg.jar%23224!/:?]
    at net.minecraft.client.renderer.entity.ItemEntityRenderer.m_7392_(ItemEntityRenderer.java:20) ~[client-1.18.2-20220404.173914-srg.jar%23224!/:?]
    at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:129) ~[client-1.18.2-20220404.173914-srg.jar%23224!/:?]
    ... 20 more
IchHabeHunger54 commented 4 months ago

Known issue, fixed in upcoming update.