From 704c4e93dc9583fe01936ee0ae7ab763adfebba7 Mon Sep 17 00:00:00 2001 From: ModularityEnjoyer <248668756+ModularityEnjoyer@users.noreply.github.com> Date: Sun, 4 Jan 2026 04:40:21 +0000 Subject: [PATCH] Fix Dynamic Item Responder Chip compatibility with Storage Drawers --- .../storagedrawers/PluginStorageDrawers.scala | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/scala/mrtjp/projectred/compatibility/storagedrawers/PluginStorageDrawers.scala b/src/main/scala/mrtjp/projectred/compatibility/storagedrawers/PluginStorageDrawers.scala index 929f6df5b..b008ee612 100644 --- a/src/main/scala/mrtjp/projectred/compatibility/storagedrawers/PluginStorageDrawers.scala +++ b/src/main/scala/mrtjp/projectred/compatibility/storagedrawers/PluginStorageDrawers.scala @@ -72,7 +72,31 @@ class StorageDrawersInvWrapper(inv: IInventory) extends InvWrapper(inv) { stored } - override def hasItem(item: ItemKey) = getItemCount(item) > 0 + override def hasItem(item: ItemKey): Boolean = { + return hasPrototype(item) + } + + def hasPrototype(item: ItemKey): Boolean = { + val totalDrawers = getDrawers.getDrawerCount + var i = 0 + + while (i < totalDrawers) { + val drawer = getDrawers.getDrawer(i) + + if (drawer != null) { + val prototypeStack = drawer.getStoredItemPrototype + val prototypeKey = ItemKey.get(prototypeStack) + + if (prototypeKey != null) { + if (prototypeKey == item) { + return true + } + } + } + i = i + 1 + } + return false + } override def injectItem(item: ItemKey, toAdd: Int): Int = { var added = 0