McJtyMods/RFToolsBuilder

1.19.1-5.2.3 NullPointerException: Cannot invoke "net.minecraft.core.BlockPos.m_123341_()" because "this.shieldProjector" is null

Closed this issue · 6 comments

Hello

I wanted to let you know that when using Direwolf20's Building Gadgets mod, I'm copy/pasting a structure of cobblestone and the structure is touching an activated & powered rftools shield at some point, which caused this crash

EDIT: It also just crashed with the unactivated shield blocks (so, after a wrench hit)

It must be placing blocks in a weird non-conventional way that the shield blocks do not expect

Description: Exception ticking world

java.lang.NullPointerException: Cannot invoke "net.minecraft.core.BlockPos.m_123341_()" because "this.shieldProjector" is null
	at mcjty.rftoolsbuilder.modules.shield.blocks.ShieldingTileEntity.m_183515_(ShieldingTileEntity.java:116) ~[rftoolsbuilder-1.19.1-5.2.3.jar%23675!/:1.19.1-5.2.3] {re:classloading}
	at mcjty.rftoolsbuilder.modules.shield.blocks.ShieldingTileEntity.getUpdatePacket(ShieldingTileEntity.java:39) ~[rftoolsbuilder-1.19.1-5.2.3.jar%23675!/:1.19.1-5.2.3] {re:classloading}
	at mcjty.rftoolsbuilder.modules.shield.blocks.ShieldingTileEntity.m_58483_(ShieldingTileEntity.java:21) ~[rftoolsbuilder-1.19.1-5.2.3.jar%23675!/:1.19.1-5.2.3] {re:classloading}
	at net.minecraft.server.level.ChunkHolder.m_140029_(ChunkHolder.java:244) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,re:mixin}
	at net.minecraft.server.level.ChunkHolder.m_140032_(ChunkHolder.java:236) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,re:mixin}
	at net.minecraft.server.level.ChunkHolder.m_140076_(ChunkHolder.java:222) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,re:mixin}
	at net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket.m_132992_(ClientboundSectionBlocksUpdatePacket.java:72) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:connectivity.mixins.json:SMultiBlockChangePacketMixin,pl:mixin:A}
	at net.minecraft.server.level.ChunkHolder.m_140054_(ChunkHolder.java:221) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,re:mixin}
	at net.minecraft.server.level.ServerChunkCache.m_184021_(ServerChunkCache.java:372) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}
	at net.minecraft.server.level.ServerChunkCache.m_8490_(ServerChunkCache.java:371) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at net.minecraft.server.level.ServerChunkCache.m_201698_(ServerChunkCache.java:310) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:285) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:ServerLevelMixin,pl:mixin:APP:supplementaries-common.mixins.json:ServerLevelMixin,pl:mixin:APP:botania_xplat.mixins.json:ServerLevelMixin,pl:mixin:APP:immersiveengineering.mixins.json:coremods.ServerWorldMixin,pl:mixin:APP:corgilib.mixins.json:MixinServerLevel,pl:mixin:APP:byg.mixins.json:common.world.MixinServerLevel,pl:mixin:APP:ad_astra-common.mixins.json:ServerLevelMixin,pl:mixin:APP:observable.common.json:ServerLevelMixin,pl:mixin:APP:betterdeserttemples.mixins.json:ServerLevelMixin,pl:mixin:APP:ars_elemental.mixins.json:ServerLevelMixin,pl:mixin:APP:create.mixins.json:accessor.ServerLevelAccessor,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:866) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:access.MinecraftServerAccess,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:292) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:nochatreports.mixins.json:server.MixinDedicatedServer,pl:mixin:APP:tombstone.mixins.json:DedicatedServerMixin,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:access.MinecraftServerAccess,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:access.MinecraftServerAccess,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[server-1.19.2-20220805.130853-srg.jar%23757!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:APP:structure_gel.mixins.json:MinecraftServerMixin,pl:mixin:APP:ae2.mixins.json:spatial.MinecraftServerMixin,pl:mixin:APP:byg.mixins.json:access.MinecraftServerAccess,pl:mixin:APP:byg.mixins.json:server.MixinMinecraftServer,pl:mixin:APP:elementalcraft.mixins.json:MixinMinecraftServer,pl:mixin:A}
	at java.lang.Thr
[crash-2023-05-06_18.50.53-server.txt](https://github.com/McJtyMods/RFToolsBuilder/files/11412911/crash-2023-05-06_18.50.53-server.txt)
ead.run(Thread.java:833) [?:?] {re:mixin}

I'm attaching the crash log

crash-2023-05-06_18.50.53-server.txt

McJty commented

Did you report this to building gadgets too? Might be on their side

zabory commented

Im getting the same error here on a server. Wont allow my players to join if they load into a chunk with a shield projector/shields

Log Snippit [23Dec2023 09:37:29.950] [Server thread/ERROR] [net.minecraft.world.level.chunk.LevelChunk/]: A BlockEntity type mcjty.rftoolsbuilder.modules.shield.blocks.ShieldingTileEntity has thrown an exception trying to write state. It will not persist, Report this to the mod author java.lang.NullPointerException: Cannot invoke "net.minecraft.core.BlockPos.m_123341_()" because "this.shieldProjector" is null at mcjty.rftoolsbuilder.modules.shield.blocks.ShieldingTileEntity.m_183515_(ShieldingTileEntity.java:116) ~[rftoolsbuilder-1.20-6.0.2.jar%23791!/:1.20-6.0.2] at net.minecraft.world.level.block.entity.BlockEntity.m_187482_(BlockEntity.java:77) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.world.level.block.entity.BlockEntity.m_187480_(BlockEntity.java:64) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.world.level.chunk.LevelChunk.m_8051_(LevelChunk.java:376) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.world.level.chunk.storage.ChunkSerializer.m_63454_(ChunkSerializer.java:324) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ChunkMap.m_140258_(ChunkMap.java:829) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ChunkMap.m_198874_(ChunkMap.java:796) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ChunkMap.m_140353_(ChunkMap.java:490) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ChunkMap.m_140280_(ChunkMap.java:454) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ServerChunkCache.m_201698_(ServerChunkCache.java:316) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:305) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:893) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23885!/:?] at java.lang.Thread.run(Thread.java:1623) ~[?:?]
McJty commented

@zabory how did this happen?

zabory commented

The shield projectors were placed and activated. Overnight the server restarted and then players who would walk into chunks that load a shield projector or login to the same chunk would lose connection or infinitely load a void world and not be able to play.

I was able to remove the mod from the pack and load the world and then re-add the mod to remove all retools blocks from the world.

I am on the all the mods 9 mod pack version 0.2.32 which uses rftoolsbuilder version 6.0.2
rftoolsbase version 5.0.2

McJty commented

I will add protection against this crash but I'm not sure why it happened in the first place

McJty commented

Fixed next version