|
1 | 1 | --- a/net/minecraft/data/Main.java
|
2 | 2 | +++ b/net/minecraft/data/Main.java
|
3 |
| -@@ -73,21 +_,34 @@ |
| 3 | +@@ -73,21 +_,32 @@ |
4 | 4 | OptionSpec<Void> optionspec1 = optionparser.accepts("server", "Include server generators");
|
5 | 5 | OptionSpec<Void> optionspec2 = optionparser.accepts("dev", "Include development tools");
|
6 | 6 | OptionSpec<Void> optionspec3 = optionparser.accepts("reports", "Include data reports");
|
|
10 | 10 | OptionSpec<String> optionspec5 = optionparser.accepts("output", "Output folder").withRequiredArg().defaultsTo("generated");
|
11 | 11 | OptionSpec<String> optionspec6 = optionparser.accepts("input", "Input folder").withRequiredArg();
|
12 | 12 | + OptionSpec<String> existing = optionparser.accepts("existing", "Existing resource packs that generated resources can reference").withRequiredArg();
|
13 |
| -+ OptionSpec<String> existingMod = optionparser.accepts("existing-mod", "Existing mods that generated resources can reference the resource packs of").withRequiredArg(); |
14 | 13 | + OptionSpec<java.io.File> gameDir = optionparser.accepts("gameDir").withRequiredArg().ofType(java.io.File.class).defaultsTo(new java.io.File(".")).required(); //Need by modlauncher, so lets just eat it
|
15 | 14 | + OptionSpec<String> mod = optionparser.accepts("mod", "A modid to dump").withRequiredArg().withValuesSeparatedBy(",");
|
16 | 15 | + OptionSpec<Void> flat = optionparser.accepts("flat", "Do not append modid prefix to output directory when generating for multiple mods");
|
|
24 | 23 | boolean flag3 = flag || optionset.has(optionspec3);
|
25 | 24 | Collection<Path> collection = optionset.valuesOf(optionspec6).stream().map(p_129659_ -> Paths.get(p_129659_)).toList();
|
26 | 25 | - DataGenerator datagenerator = new DataGenerator(path, SharedConstants.getCurrentVersion(), true);
|
27 |
| -+ Collection<Path> existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).toList(); |
28 |
| -+ java.util.Set<String> existingMods = new java.util.HashSet<>(optionset.valuesOf(existingMod)); |
29 | 26 | + java.util.Set<String> mods = new java.util.HashSet<>(optionset.valuesOf(mod));
|
30 | 27 | + boolean isFlat = mods.isEmpty() || optionset.has(flat);
|
31 | 28 | + boolean validate = optionset.has(validateSpec);
|
32 | 29 | + DataGenerator datagenerator = new DataGenerator(isFlat ? path : path.resolve("minecraft"), SharedConstants.getCurrentVersion(), true);
|
| 30 | ++ java.util.Collection<Path> existingPacks = optionset.valuesOf(existing).stream().map(Paths::get).toList(); |
33 | 31 | + if (mods.contains("minecraft") || mods.isEmpty()) {
|
34 | 32 | addServerProviders(datagenerator, collection, flag1, flag2, flag3);
|
35 | 33 | - datagenerator.run();
|
36 | 34 | + }
|
37 |
| -+ net.neoforged.neoforge.data.loading.DatagenModLoader.begin(mods, path, collection, existingPacks, existingMods, flag2, flag3, validate, isFlat, null, null, () -> {}, |
| 35 | ++ net.neoforged.neoforge.data.loading.DatagenModLoader.begin(mods, path, collection, existingPacks, flag2, flag3, validate, isFlat, null, null, () -> {}, |
38 | 36 | + net.neoforged.neoforge.data.event.GatherDataEvent.Server::new, datagenerator);
|
39 | 37 | } else {
|
40 | 38 | optionparser.printHelpOn(System.out);
|
|
0 commit comments