Complete Multiple Quests Simultaneously in Edit Mode
This minimalist addon for FTBQuests solves one specific task: allows bulk completion of quests in edit mode. When you select multiple quests simultaneously, you get the ability to complete them all with one action through the context menu.
The modification was created to solve the problem with corrupted quest progression after modpack update. The developer implemented this functionality literally in half an hour for personal use.
Important information:
- Compatibility limited to Minecraft version 1.20.1
- The mod was created as a personal solution and is not planned for support in future versions
- Functionality tested and works correctly
Technical implementation:
@Mixin(value = QuestButton.class, remap = false)
abstract class MCompleteMultiple {
@Final
@Shadow
protected QuestScreen questScreen;
@Redirect(
method="onClicked",
at=@At(
value="INVOKE",
target="java/util/List.add (Ljava/lang/Object;)Z",
ordinal = 5
)
)
private boolean inject(List original, Object it, @Local(name="selected") Collection<Quest> selected) {
original.add(it);
var file = ((QuestScreenAccessor)questScreen).getFile();
// copied directly from FTBQuests for "Complete Instantly" button, with "for all selected" added
return original.add(new ContextMenuItem(Component.translatable("ftbquests.gui.complete_instantly"), ThemeProperties.CHECK_ICON.get(), (b) -> selected.forEach((q) -> ChangeProgressMessage.sendToServer(file.selfTeamData, q, progressChange-> progressChange.setReset(false)).setYesNoText(Component.translatable("ftbquests.gui.complete_instantly_q")));
}
}