add included mod ids to manifest
This commit is contained in:
parent
dde054f6a9
commit
f8c6b88d8f
|
@ -4,7 +4,7 @@ import java.util.*;
|
|||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public final class ModCredits implements Map<String, Collection<String>> {
|
||||
public final class ModCredits {
|
||||
|
||||
public static ModCredits of(Map<String, Collection<String>> credits){
|
||||
return new ModCredits(credits);
|
||||
|
@ -23,63 +23,15 @@ public final class ModCredits implements Map<String, Collection<String>> {
|
|||
return credits.getOrDefault(name, Collections.emptySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return credits.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return credits.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(Object key) {
|
||||
return credits.containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsValue(Object value) {
|
||||
return credits.containsValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> get(Object key) {
|
||||
return credits.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> put(String key, Collection<String> value) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> remove(Object key) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(@NotNull Map<? extends String, ? extends Collection<String>> m) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<String> keySet() {
|
||||
return credits.keySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Collection<Collection<String>> values() {
|
||||
return credits.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Set<Entry<String, Collection<String>>> entrySet() {
|
||||
public @NotNull Set<Map.Entry<String, Collection<String>>> entrySet() {
|
||||
return credits.entrySet();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,12 +118,17 @@ public class Minecraft implements NonsensePlugin {
|
|||
if (opt.isPresent()) {
|
||||
ModProperties p = opt.get();
|
||||
modProperties.add(p);
|
||||
List<String> jars = p.extensions().getOrDefault(BuiltinExtensions.INCLUDED_JARS, Collections.emptyList());
|
||||
List<List<Map<String, String>>> entries = p.extensions().getOrDefault(BuiltinExtensions.INCLUDED_JARS, Collections.emptyList());
|
||||
if (entries.isEmpty()){
|
||||
return;
|
||||
}
|
||||
try (FileSystem fs = FileSystems.newFileSystem(mod)){
|
||||
for (String jar : jars) {
|
||||
Path path = fs.getPath(jar);
|
||||
mods.add(path);
|
||||
findJiJMods(path, mods);
|
||||
for (var jars : entries) {
|
||||
for (Map<String, String> jar : jars) {
|
||||
Path path = fs.getPath(jar.get("path"));
|
||||
mods.add(path);
|
||||
findJiJMods(path, mods);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue