MWall541 / Dragon-Mounts-Legacy

Github Repository for the Dragon Mounts: Legacy Minecraft Mod. Please Report any issues here!
GNU General Public License v3.0
38 stars 36 forks source link

NPE: JEI mob drops integration crash #231

Closed yurikus closed 6 months ago

yurikus commented 6 months ago

Logs: https://pastebin.com/raw/xSKnE1Xp

Relevant mod versions dragonmounts-1.20.1-1.2.1-beta.jar JustEnoughResources-1.20.1-1.4.0.247.jar

Steps to Reproduce: Scroll in the "mob drops" section of JEI until crash

image

Description of issue: MC crashes

Description: Rendering entity in world

java.lang.NullPointerException: Cannot invoke "com.github.kay9.dragonmounts.dragon.breed.DragonBreed.id(net.minecraft.core.RegistryAccess)" because the return value of "com.github.kay9.dragonmounts.dragon.TameableDragon.getBreed()" is null
    at com.github.kay9.dragonmounts.client.DragonRenderer.getModel(DragonRenderer.java:69) ~[dragonmounts-1.20.1-1.2.1-beta.jar%23455!/:1.20.1-1.2.1-beta] {re:classloading}

-- Head --
Thread: Render thread
Suspected Mods: 
    Dragon Mounts: Legacy (dragonmounts), Version: 1.2.1-beta
        Issue tracker URL: https://github.com/Kay9Unit/Dragon-Mounts-Legacy/issues
        at TRANSFORMER/dragonmounts@1.2.1-beta/com.github.kay9.dragonmounts.client.DragonRenderer.getModel(DragonRenderer.java:69)

    Just Enough Resources (jeresources), Version: 1.4.0.247
        Issue tracker URL: https://github.com/way2muchnoise/JustEnoughResources/issues
        at TRANSFORMER/jeresources@1.4.0.247/jeresources.util.RenderHelper.lambda$renderEntity$0(RenderHelper.java:62)

    Just Enough Items (jei), Version: 15.3.0.4
        Issue tracker URL: https://github.com/mezz/JustEnoughItems/issues?q=is%3Aissue
        at TRANSFORMER/jei@15.3.0.4/mezz.jei.library.gui.recipes.RecipeLayout.drawRecipe(RecipeLayout.java:168)
MWall541 commented 6 months ago

Kind of a weird combo of issues going on here. JER should be checking if the model can render at all (shouldRender) but I also agree that the renderer for dragons should be more careful about the nullability of the breed since there's always a chance of there not being one.

Thank you for the report

yurikus commented 5 months ago

Thank you for the prompt fix. When is the next beta? This issue crashes my kid's clients every now and then.

MWall541 commented 5 months ago

I can push it out now for you. So far, not much else urgent has come up thats causing concern. Stay tuned, it'll be out in a few.

MWall541 commented 5 months ago

here you go: https://modrinth.com/mod/dragon-mounts-legacy/version/1.20.1-1.2.3-beta

yurikus commented 5 months ago

Thank you!