update mixin
Some checks failed
Publish to snapshot maven / build (push) Failing after 24s

This commit is contained in:
moehreag 2024-08-04 17:41:19 +02:00
parent 34cd3f1dac
commit a4ab17f5a8
5 changed files with 12 additions and 16 deletions

View file

@ -7,7 +7,7 @@ plugins {
} }
group = "dev.frogmc" group = "dev.frogmc"
version = "0.0.1-alpha.16" version = "0.0.1-alpha.17"
repositories { repositories {
maven { maven {
@ -18,8 +18,6 @@ repositories {
name = "FrogMC Releases" name = "FrogMC Releases"
url = uri("https://maven.frogmc.dev/releases") url = uri("https://maven.frogmc.dev/releases")
} }
maven("https://maven.fabricmc.net/")
maven("https://repo.spongepowered.org/maven")
mavenCentral() mavenCentral()
} }

View file

@ -2,7 +2,7 @@
thyroxine = "0.0.1-alpha.9" thyroxine = "0.0.1-alpha.9"
nightconfig = "3.7.3" nightconfig = "3.7.3"
mixin = "0.14.0+mixin.0.8.6" mixin = "0.15.0+mixin.0.8.7"
annotations = "24.1.0" annotations = "24.1.0"
mixinextras = "0.3.6" mixinextras = "0.3.6"

View file

@ -146,16 +146,15 @@ public class FrogMixinService implements IMixinService, IClassProvider, IClassBy
@Override @Override
public ClassNode getClassNode(String name, boolean runTransformers) throws IOException { public ClassNode getClassNode(String name, boolean runTransformers) throws IOException {
byte[] bytes; return getClassNode(name, runTransformers, 0);
if (runTransformers && transformer != null) {
bytes = transformer.transformClass(MixinEnvironment.getCurrentEnvironment(), name,
FrogLauncher.getInstance().getTargetClassLoader().getClassBytes(name));
} else {
bytes = FrogLauncher.getInstance().getTargetClassLoader().getClassBytes(name);
} }
@Override
public ClassNode getClassNode(String name, boolean runTransformers, int readerFlags) throws IOException {
byte[] bytes = FrogLauncher.getInstance().getTargetClassLoader().getClassBytes(name);
ClassReader reader = new MixinClassReader(bytes, name); ClassReader reader = new MixinClassReader(bytes, name);
ClassNode node = new ClassNode(); ClassNode node = new ClassNode();
reader.accept(node, 0); reader.accept(node, readerFlags);
return node; return node;
} }

View file

@ -1,6 +1,5 @@
package dev.frogmc.frogloader.impl.mod; package dev.frogmc.frogloader.impl.mod;
import java.nio.file.Path;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -51,9 +50,7 @@ public class ModUtil {
builder.append(p.id()).append(" (").append(p.name()).append(") ").append(" ").append(p.version()); builder.append(p.id()).append(" (").append(p.name()).append(") ").append(" ").append(p.version());
if (indent.get() == 2 && !p.paths().isEmpty()) { if (indent.get() == 2 && !p.paths().isEmpty()) {
Path source = p.paths().stream().findFirst().orElseThrow(); String path = p.paths().stream().findFirst().orElseThrow().toString();
System.out.println(source);
String path = source.toString();
if (path.startsWith(".")) { if (path.startsWith(".")) {
builder.append(" from ").append(path.substring(2)); builder.append(" from ").append(path.substring(2));
} else if (path.length() > 2) { } else if (path.length() > 2) {

View file

@ -66,11 +66,13 @@ public class MinecraftGamePlugin implements GamePlugin {
LOGGER.info("Locating game.."); LOGGER.info("Locating game..");
String jar = System.getProperty(SystemProperties.MINECRAFT_GAME_JAR); String jar = System.getProperty(SystemProperties.MINECRAFT_GAME_JAR);
if (jar != null) { if (jar != null) {
LOGGER.debug("Checking game jar path provided via system property..");
Path p = Paths.get(jar); Path p = Paths.get(jar);
if (checkLocation(p)) { if (checkLocation(p)) {
return p; return p;
} }
} }
LOGGER.debug("Locating game jar on classpath..");
for (String s : System.getProperty("java.class.path", "").split(File.pathSeparator)) { for (String s : System.getProperty("java.class.path", "").split(File.pathSeparator)) {
Path p = Paths.get(s); Path p = Paths.get(s);