Null Pointer Exception on server in com.minecolonies.api.tileentities.AbstractTileEntityColonyBuilding
Pewmaymen opened this issue ยท 0 comments
Prerequisites
- I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
- I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
- I made sure that this issue is not a duplicate of any existing issue.
Context
- Minecraft Version: 1.18.1
- MineColonies Version: 1.18.1-1.0.278-RELEASE
- Structurize Version: 1.18.1-1.0.319-BETA
- Forge Version: 39.0.0
- Java Version: 17.0.1
Problem description
Periodically, my server running a small mix of Mods, including MineColonies and Structurize, will produce the following Null Pointer Exception in the log:
[08:38:44 FATAL]: Error executing task on Server
java.lang.NullPointerException: Cannot invoke "com.minecolonies.api.tileentities.AbstractTileEntityColonyBuilding.m_6596_()" because the return value of "com.minecolonies.api.colony.buildings.IBuilding.getTileEntity()" is null
at com.minecolonies.coremod.network.messages.server.colony.building.MarkBuildingDirtyMessage.onExecute(MarkBuildingDirtyMessage.java:45) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at com.minecolonies.coremod.network.messages.server.AbstractBuildingServerMessage.onExecute(AbstractBuildingServerMessage.java:81) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at com.minecolonies.coremod.network.messages.server.AbstractColonyServerMessage.onExecute(AbstractColonyServerMessage.java:140) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at com.minecolonies.coremod.network.messages.splitting.SplitPacketMessage.lambda$onExecute$1(SplitPacketMessage.java:128) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at net.minecraftforge.network.NetworkEvent$Context.enqueueWork(NetworkEvent.java:222) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at com.minecolonies.coremod.network.messages.splitting.SplitPacketMessage.onExecute(SplitPacketMessage.java:128) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at com.minecolonies.coremod.network.NetworkChannel.lambda$setupInternalMessages$4(NetworkChannel.java:256) ~[minecolonies-1.18.1-1.0.278-RELEASE.jar%2356!:1.18.1-1.0.278-RELEASE]
at net.minecraftforge.network.simple.IndexedMessageCodec.lambda$tryDecode$3(IndexedMessageCodec.java:128) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
at net.minecraftforge.network.simple.IndexedMessageCodec.tryDecode(IndexedMessageCodec.java:128) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at net.minecraftforge.network.simple.IndexedMessageCodec.consume(IndexedMessageCodec.java:162) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at net.minecraftforge.network.simple.SimpleChannel.networkEventListener(SimpleChannel.java:82) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-5.0.3.jar%232!:?]
at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-5.0.3.jar%232!:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!:?]
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!:?]
at net.minecraftforge.network.NetworkInstance.dispatch(NetworkInstance.java:82) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at net.minecraftforge.network.NetworkHooks.lambda$onCustomPayload$1(NetworkHooks.java:89) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at java.util.Optional.map(Optional.java:260) ~[?:?]
at net.minecraftforge.network.NetworkHooks.onCustomPayload(NetworkHooks.java:89) ~[forge-1.18.1-39.0.0-universal.jar%2373!:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7423_(ServerGamePacketListenerImpl.java:1416) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket.m_5797_(ServerboundCustomPayloadPacket.java:35) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket.m_5797_(ServerboundCustomPayloadPacket.java:8) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:21) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:151) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:765) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:161) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:125) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:748) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:742) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:134) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:728) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:672) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.18.1-20211210.034407-srg.jar%2369!:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Notes or related things
Note that this does not cause any crashing or other bad behavior and things seem to continue running without issues. Users on the server do not indicate there is any obvious issue. As such, this appears to be a very benign error. Just a bit alarming is all.
Viewers
- Add a thumbs-up to the issue to vote for it. This helps the request become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.