Merge remote-tracking branch 'refs/remotes/origin/main' into owlsys/dependency-resolving
This commit is contained in:
commit
e076c98531
|
@ -23,7 +23,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.remapper){
|
||||
implementation(libs.thyroxine){
|
||||
isTransitive = false
|
||||
}
|
||||
compileOnly("org.apache.logging.log4j:log4j-slf4j2-impl:3.0.0-beta2")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
[versions]
|
||||
|
||||
remapper = "1.0.0-SNAPSHOT"
|
||||
thyroxine = "1.0.0-SNAPSHOT"
|
||||
nightconfig = "3.7.2"
|
||||
mixin = "0.13.4+mixin.0.8.5"
|
||||
annotations = "24.1.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
remapper = { module = "dev.frogmc:thyroxine", version.ref = "remapper" }
|
||||
thyroxine = { module = "dev.frogmc:thyroxine", version.ref = "thyroxine" }
|
||||
nightconfig = { module = "com.electronwill.night-config:toml", version.ref = "nightconfig" }
|
||||
mixin = { module = "net.fabricmc:sponge-mixin", version.ref = "mixin" }
|
||||
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }
|
||||
|
|
|
@ -7,12 +7,12 @@ plugins {
|
|||
|
||||
repositories {
|
||||
maven {
|
||||
name = "Esnesnon Maven/Snapshots"
|
||||
url = uri("https://maven-esnesnon.ecorous.org/snapshots")
|
||||
name = "FrogMC Maven/Snapshots"
|
||||
url = uri("https://maven-frogmc.ecorous.org/snapshots")
|
||||
}
|
||||
maven {
|
||||
name = "Esnesnon Maven/Releases"
|
||||
url = uri("https://maven-esnesnon.ecorous.org/releases")
|
||||
name = "FrogMC Maven/Releases"
|
||||
url = uri("https://maven-frogmc.ecorous.org/releases")
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@ import java.util.Optional;
|
|||
|
||||
import dev.frogmc.frogloader.api.env.Env;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import dev.frogmc.frogloader.impl.LoaderImpl;
|
||||
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
|
||||
import dev.frogmc.frogloader.impl.LoaderImpl;
|
||||
|
||||
public interface Loader {
|
||||
|
||||
static Loader getInstance(){
|
||||
static Loader getInstance() {
|
||||
return LoaderImpl.getInstance();
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,15 @@ public interface Loader {
|
|||
Env getEnv();
|
||||
|
||||
Path getGameDir();
|
||||
|
||||
Path getConfigDir();
|
||||
|
||||
Path getModsDir();
|
||||
|
||||
boolean isDevelopment();
|
||||
|
||||
boolean isModLoaded(String id);
|
||||
|
||||
Optional<ModProperties> getModProperties(String id);
|
||||
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ import java.util.stream.Collectors;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
import dev.frogmc.frogloader.api.Loader;
|
||||
import dev.frogmc.frogloader.api.env.Env;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
|
||||
import dev.frogmc.frogloader.impl.launch.MixinClassLoader;
|
||||
import dev.frogmc.frogloader.impl.mod.ModUtil;
|
||||
import lombok.Getter;
|
||||
import dev.frogmc.frogloader.api.env.Env;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
package dev.frogmc.frogloader.impl.gui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.net.URI;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import dev.frogmc.frogloader.impl.LoaderImpl;
|
||||
import dev.frogmc.frogloader.impl.mod.ModDependencyResolver;
|
||||
import dev.frogmc.frogloader.impl.mod.ModUtil;
|
||||
import dev.frogmc.frogloader.impl.util.URLUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import dev.frogmc.frogloader.impl.LoaderImpl;
|
||||
|
||||
public class LoaderGui {
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package dev.frogmc.frogloader.impl.launch;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import java.lang.invoke.MethodType;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Getter;
|
||||
import dev.frogmc.frogloader.api.env.Env;
|
||||
import dev.frogmc.frogloader.impl.mixin.NonsenseMixinService;
|
||||
import lombok.Getter;
|
||||
import org.spongepowered.asm.launch.MixinBootstrap;
|
||||
import org.spongepowered.asm.service.IPropertyKey;
|
||||
|
||||
|
|
|
@ -16,13 +16,12 @@ import org.spongepowered.asm.mixin.MixinEnvironment;
|
|||
public class MixinClassLoader extends URLClassLoader {
|
||||
|
||||
private static final ClassLoader SYSTEM = ClassLoader.getSystemClassLoader();
|
||||
private final List<String> exclusions = new ArrayList<>();
|
||||
|
||||
static {
|
||||
registerAsParallelCapable();
|
||||
}
|
||||
|
||||
private final List<String> exclusions = new ArrayList<>();
|
||||
|
||||
public MixinClassLoader() {
|
||||
super(new URL[0], null);
|
||||
excludePackage("java");
|
||||
|
|
|
@ -5,7 +5,7 @@ import dev.frogmc.frogloader.impl.launch.Launcher;
|
|||
|
||||
public class NonsenseServer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args){
|
||||
Launcher.run(args, Env.SERVER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,18 @@ package dev.frogmc.frogloader.impl.mixin;
|
|||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import dev.frogmc.frogloader.impl.launch.AccessWidener;
|
||||
import dev.frogmc.frogloader.impl.mod.BuiltinExtensions;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
|
||||
public class AWProcessor {
|
||||
|
||||
|
@ -18,7 +21,7 @@ public class AWProcessor {
|
|||
private static final Predicate<String> HEADER = Pattern.compile("accessWidener\\s+v[12]\\s+.*").asMatchPredicate();
|
||||
private static final String SEPARATOR = "[\\t ]+";
|
||||
|
||||
public static void load(Collection<ModProperties> mods){
|
||||
public static void load(Collection<ModProperties> mods) {
|
||||
Map<String, AccessWidener.Entry> classMap = new ConcurrentHashMap<>();
|
||||
Map<String, Map<String, AccessWidener.Entry>> methods = new ConcurrentHashMap<>();
|
||||
Map<String, Map<String, AccessWidener.Entry>> fields = new ConcurrentHashMap<>();
|
||||
|
|
|
@ -6,12 +6,12 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import dev.frogmc.frogloader.api.mod.ModDependencies;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import dev.frogmc.frogloader.api.mod.SemVer;
|
||||
import dev.frogmc.frogloader.impl.SemVerParseException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
@ -13,10 +13,10 @@ import com.electronwill.nightconfig.core.CommentedConfig;
|
|||
import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
||||
import com.electronwill.nightconfig.core.file.FileNotFoundAction;
|
||||
import com.electronwill.nightconfig.toml.TomlParser;
|
||||
import lombok.AllArgsConstructor;
|
||||
import dev.frogmc.frogloader.api.mod.ModDependencies;
|
||||
import dev.frogmc.frogloader.api.mod.ModExtensions;
|
||||
import dev.frogmc.frogloader.api.mod.ModProperties;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -10,18 +10,18 @@ import dev.frogmc.frogloader.api.mod.ModProperties;
|
|||
|
||||
public class ModUtil {
|
||||
|
||||
public static String getModList(Collection<ModProperties> mods) {
|
||||
public static String getModList(Collection<ModProperties> mods){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int size = mods.size();
|
||||
builder.append("Loaded ").append(size).append(" mod");
|
||||
if (size > 1) {
|
||||
if (size > 1){
|
||||
builder.append("s");
|
||||
}
|
||||
builder.append(":");
|
||||
int i = 0;
|
||||
for (ModProperties p : mods) {
|
||||
builder.append("\n\t");
|
||||
if (i < size - 1) {
|
||||
if (i < size-1) {
|
||||
builder.append("|- ");
|
||||
} else {
|
||||
builder.append("\\- ");
|
||||
|
|
|
@ -6,9 +6,9 @@ import java.util.function.IntSupplier;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import lombok.NonNull;
|
||||
import dev.frogmc.frogloader.api.mod.SemVer;
|
||||
import dev.frogmc.frogloader.impl.SemVerParseException;
|
||||
import lombok.NonNull;
|
||||
|
||||
public record SemVerImpl(int major, int minor, int patch, String prerelease, String build) implements SemVer {
|
||||
// Adapted from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
||||
|
|
|
@ -12,8 +12,6 @@ import java.util.*;
|
|||
|
||||
import com.google.gson.JsonObject;
|
||||
import dev.frogmc.frogloader.api.Loader;
|
||||
import dev.frogmc.frogloader.impl.gui.LoaderGui;
|
||||
import dev.frogmc.frogloader.impl.mod.*;
|
||||
import dev.frogmc.frogloader.api.extensions.PreLaunchExtension;
|
||||
import dev.frogmc.frogloader.api.mod.ModDependencies;
|
||||
import dev.frogmc.frogloader.api.mod.ModExtensions;
|
||||
|
@ -21,9 +19,10 @@ import dev.frogmc.frogloader.api.mod.ModProperties;
|
|||
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
|
||||
import dev.frogmc.frogloader.impl.Discovery;
|
||||
import dev.frogmc.frogloader.impl.LoaderImpl;
|
||||
import dev.frogmc.frogloader.impl.gui.LoaderGui;
|
||||
import dev.frogmc.frogloader.impl.mixin.AWProcessor;
|
||||
import org.ecorous.esnesnon.nonsense.loader.impl.mod.*;
|
||||
import org.ecorous.esnesnon.nonsense_remapper.NonsenseRemapper;
|
||||
import dev.frogmc.frogloader.impl.mod.*;
|
||||
import dev.frogmc.thyroxine.Thyroxine;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongepowered.asm.mixin.Mixins;
|
||||
|
@ -109,7 +108,7 @@ public class Minecraft implements NonsensePlugin {
|
|||
|
||||
if (!loader.isDevelopment()) {
|
||||
if (!Files.exists(remappedGamePath)) {
|
||||
NonsenseRemapper.run(version, gamePath, remappedGamePath, true, false);
|
||||
Thyroxine.run(version, gamePath, remappedGamePath, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package dev.frogmc.frogloader.impl.plugin.game.minecraft;
|
||||
|
||||
import dev.frogmc.frogloader.impl.mod.SemVerImpl;
|
||||
import dev.frogmc.frogloader.api.mod.SemVer;
|
||||
import dev.frogmc.frogloader.impl.SemVerParseException;
|
||||
import dev.frogmc.frogloader.impl.mod.SemVerImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class MinecraftSemVerImpl implements SemVer {
|
||||
|
|
|
@ -3,10 +3,10 @@ format_version = "1.0.0"
|
|||
|
||||
[frog.mod]
|
||||
id = "frogloader"
|
||||
name = "Nonsense Loader"
|
||||
name = "FrogLoader"
|
||||
version = "${version}"
|
||||
license = "Apache-2.0"
|
||||
credits = [
|
||||
{ name = "Nonsense Team", roles = ["author"] }
|
||||
{ name = "FrogMC Team", roles = ["author"] }
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue