JustEnoughResources icon indicating copy to clipboard operation
JustEnoughResources copied to clipboard

JER causing errors or crashes when viewing Mob Drops window containing mobs "ponified" by Mine Little Pony mod.

Open KandiPanda opened this issue 4 years ago • 8 comments

Does not have problems with non-ponified mobs.

With MineLP 1.12.2.3.2.4, ponified mobs simply don't display in the JER Mob Drops window, and the log file is spammed many times per second with [Client thread/ERROR] [net.minecraft.client.renderer.entity.RenderLivingBase]: Couldn't render entity java.lang.NullPointerException: null multiple times per second.

With MineLP 1.12.2.3.2.6 or 1.12.2.3.2.7, the game completely crashes when trying to view a Mob Drops window, with the error in the log starting with Description: Rendering entity in world java.lang.NullPointerException: Rendering entity in world.

Discussing it with a dev of that mod, they tell me that the issue is that your dummy world should be passing an empty chunk full of air, rather than passing a null chunk as it currently does.

The versions of their mod mentioned above can be found on this releases page.

KandiPanda avatar Nov 12 '19 14:11 KandiPanda

Could you post a full crash log? (via gist or pastebin)

way2muchnoise avatar Nov 13 '19 13:11 way2muchnoise

Not sure which of these you wanted, so I grabbed all of them, if any are unneded just let me know and I can make them go away:

crash-2019-11-15_23.17.44-client.txt debug.log latest.log

KandiPanda avatar Nov 16 '19 05:11 KandiPanda

I've encountered related problem when trying to add integration with other mods. I'm running on 1.12.2-0.9.2.60, and if you want to know which entities it happens with, it's a few entities from Mo' Creatures - turtle, snake, and all medium fish.

In my case, the entity renderer is trying to call boolean isInsideOfMaterial(Material materialIn) from the class Entity, which then is trying to call IBlockState getBlockState(BlockPos pos), which is then trying to call Chunk getChunk(BlockPos pos) (both of these inside the World class).

Looking at the crash log provided by @KandiPanda it looks like the crash is caused by call to boolean isOnLadder() inside of EntityLivingBase class, which is also trying to call IBlockState getBlockState(BlockPos pos).

I'm not sure if it'd solve both issues or not, but I think that one way to solve (besides returning a chunk filled with air) could be to override getBlockState and return Blocks.AIR.getDefaultState(); inside of your FakeClientWorld.

SokyranTheDragon avatar Nov 24 '19 10:11 SokyranTheDragon

Not really a fan of returning a default blockstate, but I'll think about it if the World is supposed to be "non-null".

way2muchnoise avatar Nov 25 '19 07:11 way2muchnoise

I've managed to fix it on my side by replacing the rendering code used by entities from other mods causing issues, and checking if the world is an instance of FakeClientWorld to do rendering without using the world.

It might be a little hacky, but it works. I know that it doesn't really help solve the original issue, but I'm just posting here to make it more clear that there's one less person with one less mod needing a change there.

SokyranTheDragon avatar Dec 25 '19 16:12 SokyranTheDragon

I'm a little curious why you need to use a fake world for this at all when the client has the real world which will work just fine.

Sollace avatar Jan 09 '20 09:01 Sollace

Refer to this for a working dummy world: https://github.com/MineLittlePony/HDSkins/blob/master/src/main/java/com/minelittlepony/hdskins/dummy/DummyWorld.java

Sollace avatar Jan 09 '20 09:01 Sollace

@Sollace might be legacy from older version where the client didn't have a real world when playing on a server. Will checkout your dummy and compare.

way2muchnoise avatar Jan 09 '20 14:01 way2muchnoise

Closing old version issues

way2muchnoise avatar Aug 08 '23 17:08 way2muchnoise