aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric/src/main/java/me/lucko/spark
diff options
context:
space:
mode:
authorlucko <git@lucko.me>2023-06-08 21:35:54 +0100
committerGitHub <noreply@github.com>2023-06-08 21:35:54 +0100
commit7e1fe4231d3b098f08ee9ebb68a551016e345a73 (patch)
treed4f6c92ce81256dbda05a3005534e0c0f0265d9c /spark-fabric/src/main/java/me/lucko/spark
parente5b278047ccb7bc6b301d787474c51d162911867 (diff)
parenta89e8d3cc42702e80e2f973e79aab6090e74a72e (diff)
downloadspark-7e1fe4231d3b098f08ee9ebb68a551016e345a73.tar.gz
spark-7e1fe4231d3b098f08ee9ebb68a551016e345a73.tar.bz2
spark-7e1fe4231d3b098f08ee9ebb68a551016e345a73.zip
Merge pull request #332 from embeddedt/forge-1.7.10
1.7.10 update
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java8
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java1
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/smap/SourceDebugCache.java1
3 files changed, 5 insertions, 5 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java
index 51834fc..ef22d9c 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java
@@ -31,7 +31,6 @@ import me.lucko.spark.fabric.smap.SourceMapProvider;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
-import org.checkerframework.checker.nullness.qual.Nullable;
import org.objectweb.asm.Type;
import org.spongepowered.asm.mixin.FabricUtil;
import org.spongepowered.asm.mixin.extensibility.IMixinConfig;
@@ -73,7 +72,7 @@ public class FabricClassSourceLookup extends ClassSourceLookup.ByCodeSource {
}
@Override
- public @Nullable String identify(MethodCall methodCall) throws Exception {
+ public String identify(MethodCall methodCall) throws Exception {
String className = methodCall.getClassName();
String methodName = methodCall.getMethodName();
String methodDesc = methodCall.getMethodDescriptor();
@@ -99,7 +98,7 @@ public class FabricClassSourceLookup extends ClassSourceLookup.ByCodeSource {
}
@Override
- public @Nullable String identify(MethodCallByLine methodCall) throws Exception {
+ public String identify(MethodCallByLine methodCall) throws Exception {
String className = methodCall.getClassName();
String methodName = methodCall.getMethodName();
int lineNumber = methodCall.getLineNumber();
@@ -143,7 +142,8 @@ public class FabricClassSourceLookup extends ClassSourceLookup.ByCodeSource {
private static String modIdFromMixinClass(String mixinClassName) {
for (Config config : MixinUtils.getMixinConfigs().values()) {
IMixinConfig mixinConfig = config.getConfig();
- if (mixinClassName.startsWith(mixinConfig.getMixinPackage())) {
+ String mixinPackage = mixinConfig.getMixinPackage();
+ if (!mixinPackage.isEmpty() && mixinClassName.startsWith(mixinPackage)) {
return mixinConfig.getDecoration(FabricUtil.KEY_MOD_ID);
}
}
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java
index cfc8c95..8b7e138 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkMixinPlugin.java
@@ -21,6 +21,7 @@
package me.lucko.spark.fabric.plugin;
import me.lucko.spark.fabric.smap.SourceDebugCache;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.objectweb.asm.tree.ClassNode;
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/smap/SourceDebugCache.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/smap/SourceDebugCache.java
index 88adae6..6af2a79 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/smap/SourceDebugCache.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/smap/SourceDebugCache.java
@@ -25,7 +25,6 @@ import org.spongepowered.asm.service.IClassBytecodeProvider;
import org.spongepowered.asm.service.MixinService;
import java.util.Map;
-import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
/**