Skip to content

Server crash: IllegalStateException: No pattern found for ItemResource[item=minecraft:air] in CitizenGridBlockEntity autocrafting #202

Description

@sir-arpatsche

The server crashes repeatedly with a "Ticking block entity" crash caused by the RefinedStorage integration in CitizenGridBlockEntity. It has happened twice so far, at two different colonies/citizen grids, so it doesn't seem tied to one specific block or colonist.

Crash log excerpt:

java.lang.IllegalStateException: No pattern found for ItemResource[item=minecraft:air, components={}]
at com.refinedmods.refinedstorage.api.autocrafting.calculation.CraftingCalculatorImpl.calculate(CraftingCalculatorImpl.java:51)
at com.refinedmods.refinedstorage.api.autocrafting.task.TaskPlanCraftingCalculatorListener.calculatePlan(TaskPlanCraftingCalculatorListener.java:31)
at com.refinedmods.refinedstorage.api.network.impl.autocrafting.AutocraftingNetworkComponentImpl.startTask(AutocraftingNetworkComponentImpl.java:159)
at steve_gall.minecolonies_compatibility.module.common.refinedstorage.CitizenGridBlockEntity$StorageView.updateAutocraftings(CitizenGridBlockEntity.java:519)
at steve_gall.minecolonies_compatibility.core.common.building.module.AbstractNetworkStorageView.tick(AbstractNetworkStorageView.java:46)
at steve_gall.minecolonies_compatibility.core.common.building.module.QueueNetworkStorageView.tick(QueueNetworkStorageView.java:20)
at steve_gall.minecolonies_compatibility.module.common.refinedstorage.CitizenGridBlockEntity$StorageView.tick(CitizenGridBlockEntity.java:584)
at steve_gall.minecolonies_compatibility.module.common.refinedstorage.CitizenGridBlockEntity.doWork(CitizenGridBlockEntity.java:94)

What I think is happening:

It looks like updateAutocraftings() is passing a citizen's item request to RefinedStorage's autocrafting calculator even when the request has resolved to minecraft:air (i.e. an empty/invalid ItemStack). RefinedStorage understandably can't find a crafting pattern for "air" and throws an IllegalStateException instead of returning gracefully -- and since nothing catches it, it kills the whole server tick.

Steps to reproduce:

Unfortunately not 100% consistent -- it happened twice over ~16 hours on a long-running survival server with multiple active colonies, each time at a different citizen_grid block. Seems to correlate with citizens requesting items via the RefinedStorage network integration (Courier job / Network Storage feature).

Versions:

  • Minecraft: 1.21.1
  • Loader: NeoForge 21.1.250
  • MineColonies_Compatibility: 3.56 (also checked changelog of 3.57 -- doesn't mention this)
  • RefinedStorage: neoforge-2.0.9
  • MineColonies: 1.1.1367 (approx, per file listing)

Suggested fix:

Filter out empty/air ItemStacks in updateAutocraftings() (or wherever the request queue is built) before passing them to AutocraftingNetworkComponentImpl.startTask(), so an empty/invalid request is silently skipped instead of crashing the calculator.

Happy to provide the full crash report file if needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions