This commit is contained in:
parent
7f828767a8
commit
47a9d6454f
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
**1.0.4**
|
||||
* Replace Reflection With New Fabric Loader API
|
||||
* Enable Java Preview Features
|
||||
|
||||
**1.0.3**
|
||||
* Improve Java Binary Testing
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@ org.gradle.jvmargs = -Xmx1G
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version = 1.16.2
|
||||
minecraft_version = 1.16.3
|
||||
curseforge_id = 398250
|
||||
simple_minecraft_version = 1.16.2
|
||||
yarn_build = 6
|
||||
fabric_loader_version = 0.9.0+build.204
|
||||
simple_minecraft_version = 1.16.3
|
||||
yarn_build = 47
|
||||
fabric_loader_version = 0.10.3+build.211
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.3
|
||||
mod_version = 1.0.4
|
||||
maven_group = com.thebrokenrail
|
||||
|
||||
# Dependencies
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
package com.thebrokenrail.freshcoffee.util;
|
||||
|
||||
import com.thebrokenrail.freshcoffee.config.HardcodedConfig;
|
||||
import net.fabricmc.loader.FabricLoader;
|
||||
import net.fabricmc.loader.game.MinecraftGameProvider;
|
||||
import net.fabricmc.loader.util.Arguments;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -47,15 +44,7 @@ public final class ReLaunchUtil {
|
|||
// Set Entry-Point
|
||||
mainArgs.add(Util.getMainClass());
|
||||
// Get Parameters
|
||||
String[] launchArgs;
|
||||
try {
|
||||
Field launchArgsField = MinecraftGameProvider.class.getDeclaredField("arguments");
|
||||
launchArgsField.setAccessible(true);
|
||||
//noinspection deprecation
|
||||
launchArgs = ((Arguments) launchArgsField.get(FabricLoader.INSTANCE.getGameProvider())).toArray();
|
||||
} catch (IllegalAccessException | NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
String[] launchArgs = FabricLoader.getInstance().getLaunchArguments(false);
|
||||
// Add Parameters
|
||||
mainArgs.addAll(Arrays.asList(launchArgs));
|
||||
return mainArgs;
|
||||
|
@ -68,6 +57,10 @@ public final class ReLaunchUtil {
|
|||
List<String> vmArgs = new ArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments());
|
||||
// Remove Debugger
|
||||
vmArgs.removeIf(arg -> arg.startsWith("-agentlib") || arg.startsWith("-javaagent"));
|
||||
// Enable Java Preview Features
|
||||
if (!vmArgs.contains("--enable-preview")) {
|
||||
vmArgs.add("--enable-preview");
|
||||
}
|
||||
|
||||
List<String> mainArgs = getMainArgs();
|
||||
|
||||
|
|
Reference in New Issue
Block a user