[1.20.1] Ender Collection Module cannot be disabled
FoxMcloud5655 opened this issue ยท 1 comments
Base information
- Minecraft version: 1.20.1
- Mod version: 3.1.2.604
- Minecraft Forge version: 47.2.20
- Mod Pack: The Crafty Kettle 2
Description / steps to reproduce
When using the Ender Collection Module, there's an option to temporarily disable it while it's installed, useful for swapping modes as part of a group of settings. Unfortunately, the option does nothing, and blocks mined with the tool are still deposited into the Ender Chest.
Issue Analysis
I've identified the root cause of this bug. The Ender Collection Module continues to collect items even when disabled because the main collection methods don't check the module's enabled state.
Technical Details
Problem Location: EnderCollectionEntity.java lines 78-107 (insertStacks()) and 112-131 (insertStack())
Root Cause: While the module correctly inherits the isEnabled() functionality from FilteredModuleEntity, the collection methods never check this state before processing items.
Execution Flow:
- Mining tool triggers
ModuleHelper.handleItemCollection()(line 43-47) EnderCollectionEntity.insertStacks()is called directly without checkingisEnabled()- Items are collected regardless of the module's disabled state
Comparison: The Junk Filter works correctly because it uses createFilterTest() which respects isEnabled(). However, Ender Collection bypasses this check.
Code Analysis
Current problematic code:
public List<ItemStack> insertStacks(Player player, Collection<ItemStack> stacks, IOPStorage opStorage) {
if (opStorage == null) return new ArrayList<>(stacks);
// Missing: if (!isEnabled()) return new ArrayList<>(stacks);
// Collection logic continues even when disabled...
}The Fix: Add isEnabled() checks at the beginning of both collection methods.
This is a simple defensive check that maintains consistency with the existing module architecture. I'll create a PR with the fix.