A null pointer error
1cewood opened this issue · 3 comments
Hello, author! Your mod met my requirements perfectly, thank you for developing such a powerful mod. However, I found an issue that caused crashes while using the mod, I don't know exactly how it caused it, it seems that my turret kept firing for a long time before the crash. I'm attaching my crash report here.
Description: Ticking entity
java.lang.NullPointerException: Cannot invoke "dev.buildtool.kturrets.Turret.getTargets()" because "this.turret" is null
at dev.buildtool.kturrets.PresetProjectile.m_5603_(PresetProjectile.java:115) ~[%5DK-Turrets-1.1.22-1.18.2.jar%2353!/:1.1.22-1.18.2] {re:classloading}
at net.minecraft.world.level.Level.m_151518_(Level.java:602) ~[server-1.18.2-20220404.173914-srg.jar%23193!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:sliceanddice.mixins.json:LevelMixin,pl:mixin:APP:starlight.mixins.json:common.world.LevelMixin,pl:mixin:A}
crash-2023-11-15_19.56.22-server.txt
I'd like to provide you with some details. I didn't have this problem in single player mode, but my server often crashed because of this. First, both claimed and unclaimed turrets will cause crashes. Second, it seems the turret is firing continuously before each crash, but I don't see the target. Here's what I know so far. I hope it was helpful.