diff options
Diffstat (limited to 'spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java')
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/FabricClassSourceLookup.java | 8 |
1 files changed, 4 insertions, 4 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); } } |