mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Simplify ModLoader#hasCompletedState, some more cleanup to FML internals
This commit is contained in:
1 parent
ec405958c9
commit
8f7fbc76e1
16 files changed
+104
-96
No files matched your search
@@ -45,7 +45,7 @@ public class ResourcePackLoader {
|
||||
}
|
||||
|
||||
public static List<String> getPackNames() {
|
||||
return ModList.get().applyForEachModFile(mf->"mod:"+mf.getModInfos().get(0).getModId()).filter(n->!n.equals("mod:minecraft")).collect(Collectors.toList());
|
||||
return ModList.get().applyForEachModFile(mf->"mod:"+mf.getModInfos().getFirst().getModId()).filter(n->!n.equals("mod:minecraft")).toList();
|
||||
}
|
||||
|
||||
public static <V> Comparator<Map.Entry<String,V>> getSorter() {
|
||||
@@ -55,7 +55,7 @@ public class ResourcePackLoader {
|
||||
|
||||
ModList.get().getModFiles().stream()
|
||||
.filter(mf -> mf.requiredLanguageLoaders().stream().noneMatch(ls->ls.languageName().equals("minecraft")))
|
||||
.map(e -> e.getMods().get(0).getModId())
|
||||
.map(e -> e.getMods().getFirst().getModId())
|
||||
.map(e -> "mod:" + e)
|
||||
.forEach(order::add);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ResourcePackLoader {
|
||||
var root = file.findResource("");
|
||||
var supplier = new PathPackResources.PathResourcesSupplier(root);
|
||||
|
||||
var modinfo = file.getModInfos().get(0);
|
||||
var modinfo = file.getModInfos().getFirst();
|
||||
var name = "mod:" + modinfo.getModId();
|
||||
var info = new PackLocationInfo(name, Component.literal(file.getFileName()), PackSource.DEFAULT, Optional.empty());
|
||||
var meta = Pack.readPackMetadata(info, supplier, version, type);
|
||||
|
||||
@@ -26,8 +26,8 @@ class ModListCommand {
|
||||
String.format(Locale.ROOT, "%s %s : %s (%s) - %d",
|
||||
modFile.getProvider().name().replace(' ', '_'),
|
||||
modFile.getFileName(),
|
||||
modFile.getModInfos().get(0).getModId(),
|
||||
modFile.getModInfos().get(0).getVersion(),
|
||||
modFile.getModInfos().getFirst().getModId(),
|
||||
modFile.getModInfos().getFirst().getVersion(),
|
||||
modFile.getModInfos().size())).
|
||||
collect(Collectors.joining("\n\u2022 ","\n\u2022 ", ""))),
|
||||
false);
|
||||
|
||||
@@ -42,12 +42,12 @@ public class ForgeVersion {
|
||||
}
|
||||
|
||||
public static VersionChecker.Status getStatus() {
|
||||
return VersionChecker.getResult(ModList.get().getModFileById(MOD_ID).getMods().get(0)).status();
|
||||
return VersionChecker.getResult(ModList.get().getModFileById(MOD_ID).getMods().getFirst()).status();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getTarget() {
|
||||
VersionChecker.CheckResult res = VersionChecker.getResult(ModList.get().getModFileById(MOD_ID).getMods().get(0));
|
||||
VersionChecker.CheckResult res = VersionChecker.getResult(ModList.get().getModFileById(MOD_ID).getMods().getFirst());
|
||||
return res.target() == null ? "" : res.target().toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user