mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-26 22:03:10 +00:00
Begin compatibility level support, java 8 must now be explicitly enabled
This commit is contained in:
1 parent
13ac04cc88
commit
7eb61bc53a
9 files changed
+258
-51
No files matched your search
@@ -39,6 +39,7 @@ import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment.Phase;
|
||||
|
||||
|
||||
@@ -195,6 +196,22 @@ public class MixinTweaker implements ITweaker {
|
||||
public String[] getLaunchArguments() {
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the desired compatibility level as a string, used by agents to set
|
||||
* compatibility level from jar manifest
|
||||
*
|
||||
* @param level compatibility level as a string
|
||||
*/
|
||||
static void setCompatibilityLevel(String level) {
|
||||
try {
|
||||
CompatibilityLevel value = CompatibilityLevel.valueOf(level.toUpperCase());
|
||||
MixinTweaker.logger.debug("Setting mixin compatibility level: {}", value);
|
||||
MixinEnvironment.setCompatibilityLevel(value);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
MixinTweaker.logger.warn("Invalid compatibility level specified: {}", level);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a config from a jar manifest source or the command line. Supports
|
||||
|
||||
Reference in new issue
Block a user