Let /iris std update force=true give a pack the built-in modules back

A pack without modules.json could not use the update command, and a pack that
dropped a built-in had no way to get it back but writing the file by hand. With
force=true the command adds every module Iris ships that modules.json does not
list, at the version Iris ships, writes the file for a pack without one, and then
updates as usual. What the file already lists and pins stays.

The plain command and the console warning for a pack without modules.json now
point at the flag. On modded it is the same words: /iris std update <pack> force=true.
This commit is contained in:
piexel committed 2026-11-11 14:06:40 +01:00
1 parent 9cc45b41d0
commit f98b6dc548
30 files changed
+173 -26

No files matched your search

@@ -688,9 +688,13 @@ public class CommandStudio implements DirectorExecutor {
@Director(description = "Update a pack's modules to the versions this Iris ships", descriptionKey = "iris.director.commandstudio.director.update_pack_modules")
public void update(
@Param(description = "The pack to update", descriptionKey = "iris.director.commandstudio.param.dimension_update_modules", contextual = true, contextualOverride = true, defaultValue = "default", customHandler = DimensionHandler.class)
IrisDimension dimension
IrisDimension dimension,
@Param(defaultValue = "false", description = "Also add every module Iris ships that the pack does not list", descriptionKey = "iris.director.commandstudio.param.force_restore_shipped_modules", aliases = "f")
boolean force
) {
KeptModuleUpdates.takeForPack(dimension.getLoader()).forEach(sender()::sendMessage);
IrisData data = dimension.getLoader();
List<String> lines = force ? KeptModuleUpdates.restoreForPack(data) : KeptModuleUpdates.takeForPack(data);
lines.forEach(sender()::sendMessage);
}
@Director(aliases = "find-objects", description = "Capture an IGenData chunk report for nearby chunks", descriptionKey = "iris.director.commandstudio.director.capture_igendata_chunk_report_nearby_chunks", origin = DirectorOrigin.PLAYER)