diff --git a/testproject/jijtest/src/main/java/jijtest/AccessPluginClass.java b/testproject/jijtest/src/main/java/jijtest/AccessPluginClass.java new file mode 100644 index 00000000..a1aaae59 --- /dev/null +++ b/testproject/jijtest/src/main/java/jijtest/AccessPluginClass.java @@ -0,0 +1,15 @@ +package jijtest; + +import cpw.mods.modlauncher.TransformingClassLoader; +import jijtestplugin.Plugin; +import net.neoforged.fml.common.Mod; + +@Mod("jijtest") +public class AccessPluginClass { + public AccessPluginClass() { + // Validate that Plugin.class is not loaded via the transforming classloader + if (Plugin.class.getClassLoader() instanceof TransformingClassLoader) { + throw new IllegalStateException("Expected Plugin to be loaded as a plugin!"); + } + } +} diff --git a/testproject/jijtest/src/plugin/java/jijtestplugin/Plugin.java b/testproject/jijtest/src/plugin/java/jijtestplugin/Plugin.java index bfbf8b0c..33e3f011 100644 --- a/testproject/jijtest/src/plugin/java/jijtestplugin/Plugin.java +++ b/testproject/jijtest/src/plugin/java/jijtestplugin/Plugin.java @@ -1,5 +1,4 @@ package jijtestplugin; public class Plugin { - }