MarkusBordihn / BOs-Easy-NPC

Create easily NPC for your world or for your mod.
Other
20 stars 8 forks source link

[Crash Report] Crash while rendering some EasyNPCs due to NoSuchMethod error #270

Closed NonplussedUltra closed 3 months ago

NonplussedUltra commented 3 months ago

Minecraft and Mod version 🐞 Minecraft 1.20.1 EasyNPC forge-1.20.1-5.3.0 Forge 47.2.0

Description of the crash 💥 Using the EasyNPC spawn eggs for Drowned, Wolf, and possibly others, results in a crash. The world will experience the same crash upon trying to start the world again.

Steps to reproduce the crash ⚙️

  1. Use EasyNPC spawn egg to spawn a Wolf.
  2. Crash to desktop.
  3. Restart Minecraft and enter the world again.
  4. Crash to desktop during world loading.

Expected behavior before the crash ✔️ Expected the Wolf and Drowned spawn eggs to work just like the Villager and Orc spawn eggs do.

Logs 📝 crash-2024-08-01_11.40.00-client.txt debug.log

Additional context 📋 Crash occurs even when running zero other mods.

MarkusBordihn commented 3 months ago

Thanks for the report, I will take a closer look into this.

Relevant part:

java.lang.NoSuchMethodError: 'boolean de.markusbordihn.easynpc.entity.easynpc.data.AttackData.isAggressive()'
    at de.markusbordihn.easynpc.client.model.standard.StandardWolfModel.additionalModelAnimation(StandardWolfModel.java:60) ~[easy_npc-forge-1.20.1-5.3.0.jar%23147!/:5.3.0] {re:classloading}
    at de.markusbordihn.easynpc.client.model.EasyNPCModel.setupAnimation(EasyNPCModel.java:606) ~[easy_npc-forge-1.20.1-5.3.0.jar%23147!/:5.3.0] {re:classloading}
    at de.markusbordihn.easynpc.client.model.base.BaseColorableAgeableListModel.m_6973_(BaseColorableAgeableListModel.java:99) ~[easy_npc-forge-1.20.1-5.3.0.jar%23147!/:5.3.0] {re:classloading}
    at net.minecraft.client.renderer.entity.LivingEntityRenderer.m_7392_(LivingEntityRenderer.java:117) ~[client-1.20.1-20230612.114412-srg.jar%23148!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.entity.MobRenderer.m_7392_(MobRenderer.java:45) ~[client-1.20.1-20230612.114412-srg.jar%23148!/:?] {re:classloading}
    at de.markusbordihn.easynpc.client.renderer.entity.base.BaseMobModelRenderer.render(BaseMobModelRenderer.java:133) ~[easy_npc-forge-1.20.1-5.3.0.jar%23147!/:5.3.0] {re:classloading}
    at de.markusbordihn.easynpc.client.renderer.entity.base.BaseMobModelRenderer.m_7392_(BaseMobModelRenderer.java:36) ~[easy_npc-forge-1.20.1-5.3.0.jar%23147!/:5.3.0] {re:classloading}
NonplussedUltra commented 3 months ago

Building the current 1.20.1 version from source seems to solve this. BOs-Easy-NPC-1.20.1/Common/src/main/java/de/markusbordihn/easynpc/entity/easynpc/data/AttackData.java defines a method isAggressive(), whereas the version I downloaded from Curseforge defines the method m_5912_() in the same place. Forgive me for being nosy - I'm trying to learn Forge modding and poking around in the code is interesting.

MarkusBordihn commented 3 months ago

No worries. This issue was more complex to troubleshoot. It occurs exclusively with the CurseForge launcher across all versions and is mostly related to the "shipped" Java version. When using the CurseForge launcher with a different JDK, I couldn't reproduce the problem. This is also why you couldn't reproduce the issue within the code itself, as it doesn't use the same "shipped" Java version.

However, I have fixed the issue, and version 5.4.1 should now work fine. Please let me know if this is not the case or if you experience any other issues.

Thanks again for the report.