Skip to content

Commit 309efd1

Browse files
Versions
1 parent 87b1c60 commit 309efd1

25 files changed

Lines changed: 351 additions & 2089 deletions

‎MultiplexorApp/lib/cli/command_help.dart‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ const List<CommandHelpGroup> commandHelpGroups = <CommandHelpGroup>[
185185
'delete [instance] <backup-id> [--instance <name>]',
186186
'prune [instance] [--keep <n>]',
187187
]),
188-
CommandHelpGroup('template', <String>[
189-
'list',
190-
'init <name> [--type <type>] [--mc <version>] [--heap <size>] [--preset <name>] [--isolated]',
191-
'show <name>',
192-
'apply <template> <name> [--auto-build] [--sync] [--isolated]',
193-
'export <instance> <template>',
194-
'delete <name>',
195-
]),
196188
CommandHelpGroup('addons', <String>[
197189
'catalog [--json]',
198190
'list [instance] [--mc <version>] [--json]',

‎MultiplexorApp/lib/cli/local_command.dart‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ const Map<String, String> _defaults = <String, String>{
174174
'mods': 'show-source',
175175
'config': 'localize',
176176
'backup': 'list',
177-
'template': 'list',
178177
'content': 'list',
179178
'addons': 'list',
180179
'gameplay': 'doctor',
@@ -360,12 +359,6 @@ const Map<String, int> _maximumPositionals = <String, int>{
360359
'backup verify': 2,
361360
'backup delete': 2,
362361
'backup prune': 1,
363-
'template list': 0,
364-
'template init': 1,
365-
'template show': 1,
366-
'template apply': 2,
367-
'template export': 2,
368-
'template delete': 1,
369362
'addons catalog': 0,
370363
'addons list': 1,
371364
'addons set': 1,
@@ -444,11 +437,6 @@ const Map<String, int> _minimumPositionals = <String, int>{
444437
'backup restore': 1,
445438
'backup verify': 1,
446439
'backup delete': 1,
447-
'template init': 1,
448-
'template show': 1,
449-
'template apply': 2,
450-
'template export': 2,
451-
'template delete': 1,
452440
'content search': 1,
453441
'content install': 1,
454442
'content remove': 1,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// NeoForge 20/21 ids omit Minecraft's leading `1.`; their third component is
2+
/// the loader build. Year-based ids include three game components followed by
3+
/// the loader build, including zero for releases such as Minecraft 26.3.
4+
String? minecraftVersionFromNeoForgeLoader(String loaderVersion) {
5+
final RegExpMatch? match = RegExp(
6+
r'^(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?(?:-beta)?$',
7+
).firstMatch(loaderVersion.trim());
8+
if (match == null) return null;
9+
final int major = int.parse(match[1]!);
10+
final int minor = int.parse(match[2]!);
11+
if (major == 20 || major == 21) {
12+
if (match[4] != null) return null;
13+
return minor == 0 ? '1.$major' : '1.$major.$minor';
14+
}
15+
if (major < 26 || match[4] == null) return null;
16+
final int patch = int.parse(match[3]!);
17+
return patch == 0 ? '$major.$minor' : '$major.$minor.$patch';
18+
}

‎MultiplexorApp/lib/models/server_minecraft_version.dart‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import 'dart:io';
22

3+
import 'neoforge_version.dart';
4+
35
/// Returns explicit Minecraft metadata, otherwise the version in a recognized
46
/// server jar name. Paths are tried in order and symlink targets take precedence
57
/// over their aliases. Missing paths can still supply a canonical filename.
68
///
7-
/// Returns null for custom/hash names and NeoForge's loader-version filenames;
8-
/// loader versions must never become Minecraft version metadata.
9+
/// NeoForge installer names use the loader's defined Minecraft version mapping.
10+
/// Custom and hash names remain unknown.
911
String? inferServerMinecraftVersion({
1012
required String serverType,
1113
String? minecraft,
@@ -25,6 +27,7 @@ String? inferServerMinecraftVersion({
2527
'forge',
2628
'mohist',
2729
'fabric',
30+
'neoforge',
2831
}.contains(type)) {
2932
return null;
3033
}
@@ -42,6 +45,18 @@ String? inferServerMinecraftVersion({
4245
.toLowerCase();
4346
if (!filename.endsWith('.jar')) continue;
4447
final String stem = filename.substring(0, filename.length - 4);
48+
if (type == 'neoforge') {
49+
final RegExpMatch? installer = RegExp(
50+
r'^neoforge-(.+)-installer$',
51+
).firstMatch(stem);
52+
if (installer != null) {
53+
final String? version = minecraftVersionFromNeoForgeLoader(
54+
installer[1]!,
55+
);
56+
if (version != null) return version;
57+
}
58+
continue;
59+
}
4560
final String prefix = switch (type) {
4661
'paper' || 'folia' => '$type-(?:[0-9]{8}-[0-9]{6}-$type-bundler-)?',
4762
'fabric' => r'fabric-(?:server-mc\.)?',

‎MultiplexorApp/lib/models/template_summary.dart‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎MultiplexorApp/lib/services/addons/builtin_addons.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const List<Map<String, Object?>> builtinAddons = <Map<String, Object?>>[
2727
'type': 'jenkins',
2828
'url': 'https://ci.ender.zone/job/EssentialsX/',
2929
'artifactPattern': r'^EssentialsX-[^/]+\.jar$',
30-
'minecraftVersions': <String>['26.2'],
30+
'minecraftVersions': <String>['26.2', '26.3'],
3131
'label': 'development',
3232
},
3333
],

‎MultiplexorApp/lib/services/interactive_wizard.dart‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:path/path.dart' as p;
77
import '../models/build_cache.dart';
88
import '../models/build_version_catalog.dart';
99
import '../models/backup_summary.dart';
10-
import '../models/template_summary.dart';
1110
import '../models/consumer_profile.dart';
1211
import '../models/gameplay_swarm.dart';
1312
import '../utils/async_work_pool.dart';
@@ -1125,8 +1124,6 @@ class InteractiveWizard {
11251124
case WorkspaceModalAction.diagnostics:
11261125
await _shellRun(<String>['doctor']);
11271126
await Ui.pause();
1128-
case WorkspaceModalAction.templates:
1129-
await _createFromTemplate();
11301127
case WorkspaceModalAction.networks:
11311128
await _networkMenu();
11321129
case WorkspaceModalAction.buildTuning:
@@ -1296,7 +1293,6 @@ class InteractiveWizard {
12961293
await _remoteCreateMany();
12971294
case WorkspaceModalAction.buildTuning:
12981295
case WorkspaceModalAction.diagnostics:
1299-
case WorkspaceModalAction.templates:
13001296
case WorkspaceModalAction.networks:
13011297
case WorkspaceModalAction.pullBuilds:
13021298
case WorkspaceModalAction.wipe:
@@ -4411,20 +4407,6 @@ class InteractiveWizard {
44114407
// ─── Create flow ─────────────────────────────────────────────────────
44124408

44134409
Future<void> _createInstance() async {
4414-
if (passthrough.listTemplates().isNotEmpty) {
4415-
final String choice =
4416-
await menuSelect<String>('New instance', const <MenuEntry<String>>[
4417-
MenuEntry<String>('Choose platform and version', value: 'platform'),
4418-
MenuEntry<String>(
4419-
'Use an example or saved template',
4420-
value: 'template',
4421-
),
4422-
]);
4423-
if (choice == 'template') {
4424-
await _createFromTemplate();
4425-
return;
4426-
}
4427-
}
44284410
final String type = await _pickServerPlatform();
44294411
final _BuildVersionChoice versionChoice = await _pickSupportedVersion(type);
44304412
final String version = versionChoice.version;

0 commit comments

Comments
 (0)