migrate package

This commit is contained in:
moehreag 2024-05-16 13:03:03 +02:00
parent 530797fcdb
commit ab7977c1f3
24 changed files with 69 additions and 70 deletions

View file

@ -1,11 +0,0 @@
package io.github.moehreag.nonsense.loader.impl.launch.client;
import io.github.moehreag.nonsense.loader.impl.launch.Launcher;
import io.github.moehreag.nonsense.loader.api.env.Env;
public class NonsenseClient {
public static void main(String[] args){
Launcher.run(args, Env.CLIENT);
}
}

View file

@ -1,11 +0,0 @@
package io.github.moehreag.nonsense.loader.impl.launch.server;
import io.github.moehreag.nonsense.loader.impl.launch.Launcher;
import io.github.moehreag.nonsense.loader.api.env.Env;
public class NonsenseServer {
public static void main(String[] args){
Launcher.run(args, Env.SERVER);
}
}

View file

@ -1,6 +0,0 @@
package io.github.moehreag.nonsense.loader.impl.mod;
import io.github.moehreag.nonsense.loader.api.mod.ModProperties;
public record BuiltinModProperties(String id, String name) implements ModProperties {
}

View file

@ -1,9 +0,0 @@
package io.github.moehreag.nonsense.loader.impl.mod;
import java.util.Map;
import io.github.moehreag.nonsense.loader.api.mod.ModProperties;
import io.github.moehreag.nonsense.loader.api.mod.ModProvider;
public record BuiltinModProvider(ModProperties properties, Map<String, String> entrypoints) implements ModProvider {
}

View file

@ -1,11 +1,11 @@
package io.github.moehreag.nonsense.loader.api;
package org.ecorous.esnesnon.nonsense.loader.api;
import java.nio.file.Path;
import java.util.List;
import io.github.moehreag.nonsense.loader.api.env.Env;
import io.github.moehreag.nonsense.loader.impl.LoaderImpl;
import io.github.moehreag.nonsense.loader.impl.plugin.NonsensePlugin;
import org.ecorous.esnesnon.nonsense.loader.api.env.Env;
import org.ecorous.esnesnon.nonsense.loader.impl.LoaderImpl;
import org.ecorous.esnesnon.nonsense.loader.impl.plugin.NonsensePlugin;
public interface Loader {

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.api.env;
package org.ecorous.esnesnon.nonsense.loader.api.env;
import lombok.Getter;

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.api.mod;
package org.ecorous.esnesnon.nonsense.loader.api.mod;
public interface ModProperties {

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.api.mod;
package org.ecorous.esnesnon.nonsense.loader.api.mod;
import java.util.Map;

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.impl;
package org.ecorous.esnesnon.nonsense.loader.impl;
import java.io.IOException;
import java.nio.file.FileVisitResult;

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.impl;
package org.ecorous.esnesnon.nonsense.loader.impl;
import java.io.*;
import java.lang.invoke.MethodHandle;
@ -9,17 +9,17 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import io.github.moehreag.nonsense.loader.api.Loader;
import io.github.moehreag.nonsense.loader.api.env.Env;
import io.github.moehreag.nonsense.loader.impl.launch.MixinClassloader;
import io.github.moehreag.nonsense.loader.impl.plugin.NonsensePlugin;
import org.ecorous.esnesnon.nonsense.loader.api.Loader;
import org.ecorous.esnesnon.nonsense.loader.api.env.Env;
import org.ecorous.esnesnon.nonsense.loader.impl.launch.MixinClassloader;
import org.ecorous.esnesnon.nonsense.loader.impl.plugin.NonsensePlugin;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoaderImpl implements Loader {
private static final String PLUGIN_SERVICE_FILE_LOCATION = "META-INF/services/io.github.moehreag.nonsense.loader.impl.plugin.NonsensePlugin";
private static final String PLUGIN_SERVICE_FILE_LOCATION = "META-INF/services/org.ecorous.esnesnon.nonsense.loader.impl.plugin.NonsensePlugin";
// TODO decide this
public static final String MOD_FILE_EXTENSION = ".nonsense";

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.impl.launch;
package org.ecorous.esnesnon.nonsense.loader.impl.launch;
import java.io.File;
import java.lang.invoke.MethodHandle;
@ -14,8 +14,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.github.moehreag.nonsense.loader.api.env.Env;
import io.github.moehreag.nonsense.loader.impl.mixin.NonsenseMixinService;
import org.ecorous.esnesnon.nonsense.loader.api.env.Env;
import org.ecorous.esnesnon.nonsense.loader.impl.mixin.NonsenseMixinService;
import lombok.Getter;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.service.IPropertyKey;
@ -61,7 +61,7 @@ public class Launcher {
MixinBootstrap.init();
try {
Class<?> clazz = targetClassLoader.findClass("io.github.moehreag.nonsense.loader.impl.LoaderImpl");
Class<?> clazz = targetClassLoader.findClass("impl.org.ecorous.esnesnon.nonsense.loader.LoaderImpl");
MethodHandle ctor = MethodHandles.publicLookup().findStatic(clazz, "run", MethodType.methodType(void.class, String[].class, Env.class));
ctor.invoke(args, env);
} catch (Throwable e) {

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.impl.launch;
package org.ecorous.esnesnon.nonsense.loader.impl.launch;
import java.io.IOException;
import java.io.InputStream;

View file

@ -0,0 +1,11 @@
package org.ecorous.esnesnon.nonsense.loader.impl.launch.client;
import org.ecorous.esnesnon.nonsense.loader.impl.launch.Launcher;
import org.ecorous.esnesnon.nonsense.loader.api.env.Env;
public class NonsenseClient {
public static void main(String[] args){
Launcher.run(args, Env.CLIENT);
}
}

View file

@ -0,0 +1,11 @@
package org.ecorous.esnesnon.nonsense.loader.impl.launch.server;
import org.ecorous.esnesnon.nonsense.loader.impl.launch.Launcher;
import org.ecorous.esnesnon.nonsense.loader.api.env.Env;
public class NonsenseServer {
public static void main(String[] args){
Launcher.run(args, Env.SERVER);
}
}

View file

@ -1,6 +1,6 @@
package io.github.moehreag.nonsense.loader.impl.mixin;
package org.ecorous.esnesnon.nonsense.loader.impl.mixin;
import io.github.moehreag.nonsense.loader.impl.launch.Launcher;
import org.ecorous.esnesnon.nonsense.loader.impl.launch.Launcher;
import org.spongepowered.asm.service.IGlobalPropertyService;
import org.spongepowered.asm.service.IPropertyKey;

View file

@ -1,4 +1,4 @@
package io.github.moehreag.nonsense.loader.impl.mixin;
package org.ecorous.esnesnon.nonsense.loader.impl.mixin;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

View file

@ -1,6 +1,6 @@
package io.github.moehreag.nonsense.loader.impl.mixin;
package org.ecorous.esnesnon.nonsense.loader.impl.mixin;
import io.github.moehreag.nonsense.loader.impl.launch.Launcher;
import org.ecorous.esnesnon.nonsense.loader.impl.launch.Launcher;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.launch.platform.container.ContainerHandleVirtual;

View file

@ -0,0 +1,6 @@
package org.ecorous.esnesnon.nonsense.loader.impl.mod;
import org.ecorous.esnesnon.nonsense.loader.api.mod.ModProperties;
public record BuiltinModProperties(String id, String name) implements ModProperties {
}

View file

@ -0,0 +1,9 @@
package org.ecorous.esnesnon.nonsense.loader.impl.mod;
import java.util.Map;
import org.ecorous.esnesnon.nonsense.loader.api.mod.ModProperties;
import org.ecorous.esnesnon.nonsense.loader.api.mod.ModProvider;
public record BuiltinModProvider(ModProperties properties, Map<String, String> entrypoints) implements ModProvider {
}

View file

@ -1,6 +1,6 @@
package io.github.moehreag.nonsense.loader.impl.plugin;
package org.ecorous.esnesnon.nonsense.loader.impl.plugin;
import io.github.moehreag.nonsense.loader.impl.LoaderImpl;
import org.ecorous.esnesnon.nonsense.loader.impl.LoaderImpl;
public interface NonsensePlugin extends Runnable {

View file

@ -1,8 +1,8 @@
package io.github.moehreag.nonsense.loader.impl.plugin.game;
package org.ecorous.esnesnon.nonsense.loader.impl.plugin.game;
import io.github.moehreag.nonsense.loader.impl.Discovery;
import io.github.moehreag.nonsense.loader.impl.LoaderImpl;
import io.github.moehreag.nonsense.loader.impl.plugin.NonsensePlugin;
import org.ecorous.esnesnon.nonsense.loader.impl.Discovery;
import org.ecorous.esnesnon.nonsense.loader.impl.LoaderImpl;
import org.ecorous.esnesnon.nonsense.loader.impl.plugin.NonsensePlugin;
import org.ecorous.esnesnon.mojmap_patcher.MojMapPatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -115,7 +115,6 @@ public class Minecraft implements NonsensePlugin {
LOGGER.warn("Failed to locate main class!");
}
} catch (Throwable e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}

View file

@ -1 +0,0 @@
io.github.moehreag.nonsense.loader.impl.plugin.game.Minecraft

View file

@ -0,0 +1 @@
org.ecorous.esnesnon.nonsense.loader.impl.plugin.game.Minecraft

View file

@ -1 +1 @@
io.github.moehreag.nonsense.loader.impl.mixin.NonsenseGlobalPropertyService
org.ecorous.esnesnon.nonsense.loader.impl.mixin.NonsenseGlobalPropertyService