Ars Magica: Legacy

Ars Magica: Legacy

142k Downloads

[Bug]: NoSuchElementException em Spell.java

JCsvg opened this issue ยท 1 comments

commented

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
commented

Known issue, fixed in upcoming update.