Applied Energistics 2

Applied Energistics 2

137M Downloads

Fuzzy filter on export bus crashes when filter item is indestructable

pengi opened this issue ยท 1 comments

commented

Describe the bug

When having a an item indestructable (from other mod) that is normally destructable as a filter for the export bus, and having a fuzzy card installed, an exception that crashes the server is raised when used.

Since the item is not exported from the system after crash, the server crashes immediately upon next start.

Running 8.3.0-beta.1

To Reproduce

  1. Install mods:
    -- Applied Energetics 2 - version 8.3.0-beta.1
    -- Apotheosis (version 4.5.1 for me, probably other mods providing the same functionality might work)
    -- Mekanism Generators (only for infinite power source)
  2. Run in creative
  3. Create a minimal ME system (infite power source + ME controller + ME interface + disk drive)
  4. Create a normal chest, connect an export bus + fuzzy card
  5. Create an indestructable pickaxe using /affixloot ANCIENT PICKAXE. Will create an unbreakable diamond pickaxe from the "Apotheosis" mod.
  6. Add the indestructable pickaxe to the export bus as filter
  7. Create a normal pickaxe and put in the ME system

What I see

  • System crashes with exception:
Caused by: java.lang.IllegalStateException: ItemStack#isDamageable() has to be true
	at com.google.common.base.Preconditions.checkState(Preconditions.java:444) ~[guava-21.0.jar:?]
	at appeng.util.item.FuzzyItemVariantList.makeLowerBound(FuzzyItemVariantList.java:148) ~[?:8.3.0-beta.1]
	at appeng.util.item.FuzzyItemVariantList.findFuzzy(FuzzyItemVariantList.java:51) ~[?:8.3.0-beta.1]
	at appeng.util.item.ItemList.findFuzzy(ItemList.java:64) ~[?:8.3.0-beta.1]
	at appeng.util.item.ItemList.findFuzzy(ItemList.java:37) ~[?:8.3.0-beta.1]
	at appeng.parts.automation.ExportBusPart.doBusWork(ExportBusPart.java:155) ~[?:8.3.0-beta.1]
	at appeng.parts.automation.ExportBusPart.tickingRequest(ExportBusPart.java:216) ~[?:8.3.0-beta.1]
	at appeng.me.cache.TickManagerCache.onUpdateTick(TickManagerCache.java:84) ~[?:8.3.0-beta.1]
	... 17 more

Expected behavior

Except the new pickaxe to be exported to the chest

Additional context

Log: https://pastebin.com/eddxiE8z

Environment

Crash report: https://pastebin.com/W90nRBWE

Notes

Probably caused by 0bdc408 when the makeLowerBound() function added a precondition rather than defaulting the damage value in case isDamageable() is false.

commented

Oh, that was quick. Thanks :)