
Exception when delivery to Postbox
Closed this issue ยท 0 comments
Is there an existing issue for this?
- I have searched the existing issues.
Are you using the latest MineColonies Version?
- I am running the latest beta/release version of MineColonies for my Minecraft version.
I am also running the latest versions of other mods that are part of my problem.
Did you check on the Wiki? or ask on Discord?
- I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.
What were you playing at the time? Were you able to reproduce it in both settings?
- Single Player
- Multi Player
Minecraft Version
1.20
MineColonies Version
1.20.1-1.1.978-snapshot
Structurize Version
1.20.1-1.0.775-snapshot
Related Mods and their Versions
No related.
Current Behavior
Exception occurred.
[Server thread/WARN] [minecolonies/]: Statemachine for state DELIVERY threw an exception:
java.lang.NullPointerException: Cannot invoke "net.minecraftforge.common.util.NonNullSupplier.get()" because "other" is null
at net.minecraftforge.common.util.LazyOptional.orElseGet(LazyOptional.java:238) ~[forge-1.20.1-47.4.3-universal.jar%23177!/:?] {re:classloading}
at com.minecolonies.core.entity.ai.workers.service.EntityAIWorkDeliveryman.deliver(EntityAIWorkDeliveryman.java:398) ~[minecolonies-1.20.1-1.1.978-snapshot.jar%23168!/:1.20.1-1.1.978-snapshot] {re:classloading}
Expected Behavior
Delivery successfully without exception.
Reproduction Steps
- Create a new Colony.
- Build Courier's Hut and Warehouse.
- Hire a citizen at Warehouse.
- Place a Postbox anywhere.
- Request any item on Postbox GUI.
- Insert items the same name with you request into warehouse.
- Wait for the D-Man to delivery items.
- Boom.
Logs
Anything else?
I think this bug is created by #10951.
After that PR, Postbox was be not child of AbstractBlockHut.
So in AbstractBuilding#getTileEntity, Postbox can't pass conditions and return null
.
Because of this return LazyOptional.empty()
in AbstractBuildingContainer#getCapability.
Finally, The NPE was occurred on EntityAIWorkDeliveryman#deliver
.
Footer
Viewers
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report 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.