In Control!

In Control!

72M Downloads

Crash due to mob being null when using spawner.json

Closed this issue ยท 2 comments

commented

Got a crash due to mob being null when passed in here, due to magma blocks running isFireImmune on the EntityType to check if it is a valid spawn: SpawnerSystem.java#L159. The parameter is annotated @Nullable but that doesn't seem to of been checked here.

java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.EntityType.m_20672_()" because "p_187424_" is null
	at net.minecraft.world.level.block.Blocks.lambda$static$33(Blocks.java:647) ~[client-1.19.2-20220805.130853-srg.jar%23225!/:?] {re:classloading,pl:accesstransformer:B,pl:object_holder_definalize:A}
	at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.m_60643_(BlockBehaviour.java:486) ~[client-1.19.2-20220805.130853-srg.jar%23225!/:?] {re:mixin,re:classloading,pl:mixin:APP:kubejs-common.mixins.json:BlockStateBaseMixin,pl:mixin:A}
	at mcjty.incontrol.spawner.SpawnerSystem.isValidSpawn(SpawnerSystem.java:465) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}
	at mcjty.incontrol.spawner.SpawnerSystem.lambda$getValidPosConditions$2(SpawnerSystem.java:407) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}
	at mcjty.incontrol.spawner.SpawnerSystem.getValidSpawnablePosition(SpawnerSystem.java:458) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}
	at mcjty.incontrol.spawner.SpawnerSystem.getRandomPositionOnGround(SpawnerSystem.java:376) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}
	at mcjty.incontrol.spawner.SpawnerSystem.getRandomPosition(SpawnerSystem.java:286) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}
	at mcjty.incontrol.spawner.SpawnerSystem.executeRule(SpawnerSystem.java:159) ~[incontrol-1.19-7.1.10.jar%23201!/:1.19-7.1.10] {re:classloading}

crash-report.txt
spawner.json

commented

How do I even fix that... I don't know the mob yet at that point

commented

Fixed