Oshi working in dev env but not in my exported Minecraft mod #2882
-
So I am using oshi in my minecraft mod, and it works perfectly in my dev env. But when I launch my exported mod it crashes with the error message |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is likely an older version of OSHI present in the environment where you're executing your mod. Try relocating OSHI to a different package as part of your shading, e.g. in this section add entries to relocate OSHI and its dependencies: named<ShadowJar>("shadowJar") {
archiveClassifier.set("dev")
configurations = listOf(shade, modShade)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// Add these relocations
relocate("oshi", "com.github.zacgamingpro1234.shade.oshi")
relocate("com.sun.jna", "com.github.zacgamingpro1234.shade.jna")
relocate("org.slf4j", "com.github.zacgamingpro1234.shade.slf4j")
} Then use these new names in your code where you import |
Beta Was this translation helpful? Give feedback.
There is likely an older version of OSHI present in the environment where you're executing your mod.
Try relocating OSHI to a different package as part of your shading, e.g. in this section add entries to relocate OSHI and its dependencies: