fix module toggle indicator turning on when adding/removing a module
@@ -186,12 +186,14 @@ public class CustomizeBlockScreen extends AbstractContainerScreen<CustomizeBlock
//when removing a stack from a slot, it's not possible to reliably get the module type, so just loop through all possible types
for (int i = 0; i < moduleInv.getMaxNumberOfModules(); i++) {
if (descriptionButtons[i] != null) {
- descriptionButtons[i].active = moduleInv.hasModule(moduleInv.acceptedModules()[i]);
+ ModuleType type = moduleInv.acceptedModules()[i];
+
+ descriptionButtons[i].active = moduleInv.hasModule(type);
if (!descriptionButtons[i].active)
- indicators.remove(moduleInv.acceptedModules()[i]);
- else
- indicators.put(moduleInv.acceptedModules()[i], true);
+ indicators.remove(type);
+ else if (!indicators.containsKey(type))
+ indicators.put(type, true);
}
}
}
