desht / ModularRouters

A Forge Mod for item routers with pluggable modules
16 stars 20 forks source link

Stack Upgrade interferes with Regulator Augment #203

Open drinkerofchai opened 7 months ago

drinkerofchai commented 7 months ago

Describe the bug

When a Modular Router has stack upgrades and modules with regulator augments, regulator augments multiply their set value by 2 to the power of the number of stack upgrades. This seems to be a case of stack upgrades somehow applying their effect to regulator augments when this should not be the case.

How to reproduce the bug

Place stack upgrades and a module with a regulator augment set to some number above 0 into a modular router. The module will not trigger until at least double or more, depending on the number of stack upgrades, of the amount of items configured in the regulator are present in either the configured inventory or the router's buffer.

image image

Expected behavior

Regulator augment functioning to be unaffected by presence of stack upgrades.

Additional details

Versions Minecraft 1.20.1 Neoforge 47.1.79 Modular Routers 12.0.2+mc1.20.1

Tested with no other mods present.

Which Minecraft version are you using?

1.20

Crash log

No response

drinkerofchai commented 7 months ago

I... misclicked.

desht commented 6 months ago

Sorry for the delay.

Say you have a puller with a regulator augment, regulating to 6 items. And you have a router with 3 stack upgrades, so pulling 8 items at a time. Then put 64 items in a chest targeted by the puller.

Without stack upgrades, the router would normally pull 58 items from the chest (leaving 6 items).

With 3 stack upgrades, the router will pull 56 items. This is because it now wants to pull 8 items at a time, and it won't do a partial pull if enough items are available (in the case it would be items, because the regulator prevents going below 6 items remaining in the chest).

This is in fact intended behaviour.