aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java')
-rw-r--r--src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java b/src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java
index 3c32931..f7431ad 100644
--- a/src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java
+++ b/src/main/java/moe/nea/modernjava/launch/FCPEntryPoint.java
@@ -1,16 +1,25 @@
package moe.nea.modernjava.launch;
+import moe.nea.modernjava.launch.live.FCPFixTweaker;
import moe.nea.modernjava.launch.util.ClassLoaderManipulations;
+import moe.nea.modernjava.launch.util.WellKnownBlackboard;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import java.net.URI;
import java.util.List;
import java.util.Map;
+import static moe.nea.modernjava.launch.util.PropertyNames.HAS_RELAUNCHED;
+/**
+ * Global entrypoint for both the FML part of the relaunched (live) and the relaunching (relaunch) runs. Execution
+ * begins during static initialization to be as early as possible. There aren't any security implications, but especially
+ * on Windows it can be problematic if two processes try to open up the same file, so we try to avoid these conflicts.
+ * Also, it's just a faster launch.
+ */
@IFMLLoadingPlugin.Name("ModernJavaRelauncher")
public class FCPEntryPoint implements IFMLLoadingPlugin {
- static URI fileUri;
+ public static URI fileUri;
static {
try {
@@ -18,9 +27,10 @@ public class FCPEntryPoint implements IFMLLoadingPlugin {
} catch (Exception e) {
throw new RuntimeException(e);
}
- if (System.getProperty("modernjava.hasrelaunched") == null) {
+ if (System.getProperty(HAS_RELAUNCHED) == null) {
try {
- Class.forName("moe.nea.modernjava.launch.FCPRelauncher").getMethod("relaunch").invoke(null);
+ Class.forName("moe.nea.modernjava.launch.relaunch.FCPRelauncher")
+ .getMethod("relaunch").invoke(null);
} catch (Throwable t) {
System.out.println("Failed to relaunch");
t.printStackTrace();
@@ -32,7 +42,7 @@ public class FCPEntryPoint implements IFMLLoadingPlugin {
throw new RuntimeException(e);
}
List<String> tweakClasses = WellKnownBlackboard.tweakerNames();
- tweakClasses.add(FCPMixinAwareTweaker.class.getName());
+ tweakClasses.add(FCPFixTweaker.class.getName());
}
}