Priority: HIGH
Status: BUG
Found in: Barbarian character creation (likely affects other classes too)
Bug Description
When selecting equipment during character creation, clicking one option sometimes selects MULTIPLE options unintentionally.
Steps to Reproduce
- Create a Barbarian character
- Navigate to equipment selection
- Click "2 Handaxes" in the second equipment choice
Expected: Only "2 Handaxes" gets selected
Actual: BOTH "2 Handaxes" AND "Any Simple Weapon" get selected
- Similarly, click "Greataxe" in first equipment choice
Expected: Only "Greataxe" gets selected
Actual: BOTH "Greataxe" AND "Any Martial Melee Weapon" get selected
Barbarian Equipment Choices (YAML)
player_choices:
- id: class_equipment_1
title: Starting Equipment 1
choose: 1
options:
- - item: greataxe
- - tag: martial_melee_weapon
- id: class_equipment_2
title: Starting Equipment 2
choose: 1
options:
- - item: handaxe
quantity: 2
- - tag: simple_weapon
Root Cause Hypothesis
In MergedChoice.toggleOption() (lines 159-164), when selecting an option:
// Find which source(s) can have this option
List<PendingChoice<?>> candidateSources = new ArrayList<>();
for (PendingChoice<?> pc : sourcePendingChoices) {
if (pc.optionKeys().contains(optionKey)) {
candidateSources.add(pc);
}
}
Problem: If the same option key appears in multiple PendingChoice sources (e.g., greataxe appears in both equipment_1 and equipment_2 due to tag expansion), it will add the option to MULTIPLE sources instead of just one.
Why This Happens
greataxe is a martial melee weapon
- When
tag:martial_melee_weapon gets expanded, greataxe becomes an available option in BOTH:
- Direct
item:greataxe in equipment_1
- Expanded from
tag:martial_melee_weapon in equipment_1
Similarly for handaxe:
handaxe is a simple weapon
- It appears as both direct
item:handaxe AND in the expanded tag:simple_weapon list
Expected Behavior
Clicking an option should only select it in ONE PendingChoice (the specific choice it belongs to), not all choices that happen to contain that option key.
Proposed Fix
MergedChoice.toggleOption() needs to be smarter about which source to select in:
- Prioritize the source where this is the primary option (not from tag expansion)
- OR: Only select in ONE candidate source, not all of them
- OR: Check which specific choice the user clicked from (pass choice ID in payload)
Files to Investigate
src/main/java/io/papermc/jkvttplugin/data/model/MergedChoice.java:146-186
src/main/java/io/papermc/jkvttplugin/ui/handler/TabbedChoicesHandler.java:41-71
- Tag expansion logic in equipment option building
Testing Checklist
Related Issues
This might also affect other merged choices where options overlap between sources.
Priority: HIGH
Status: BUG
Found in: Barbarian character creation (likely affects other classes too)
Bug Description
When selecting equipment during character creation, clicking one option sometimes selects MULTIPLE options unintentionally.
Steps to Reproduce
Expected: Only "2 Handaxes" gets selected
Actual: BOTH "2 Handaxes" AND "Any Simple Weapon" get selected
Expected: Only "Greataxe" gets selected
Actual: BOTH "Greataxe" AND "Any Martial Melee Weapon" get selected
Barbarian Equipment Choices (YAML)
Root Cause Hypothesis
In
MergedChoice.toggleOption()(lines 159-164), when selecting an option:Problem: If the same option key appears in multiple PendingChoice sources (e.g.,
greataxeappears in both equipment_1 and equipment_2 due to tag expansion), it will add the option to MULTIPLE sources instead of just one.Why This Happens
greataxeis a martial melee weapontag:martial_melee_weapongets expanded,greataxebecomes an available option in BOTH:item:greataxein equipment_1tag:martial_melee_weaponin equipment_1Similarly for handaxe:
handaxeis a simple weaponitem:handaxeAND in the expandedtag:simple_weaponlistExpected Behavior
Clicking an option should only select it in ONE PendingChoice (the specific choice it belongs to), not all choices that happen to contain that option key.
Proposed Fix
MergedChoice.toggleOption()needs to be smarter about which source to select in:Files to Investigate
src/main/java/io/papermc/jkvttplugin/data/model/MergedChoice.java:146-186src/main/java/io/papermc/jkvttplugin/ui/handler/TabbedChoicesHandler.java:41-71Testing Checklist
Related Issues
This might also affect other merged choices where options overlap between sources.