Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Framework has not been relocated correctly! #14

Closed
KweezyCode opened this issue Jul 7, 2024 · 2 comments
Closed

Command Framework has not been relocated correctly! #14

KweezyCode opened this issue Jul 7, 2024 · 2 comments

Comments

@KweezyCode
Copy link

KweezyCode commented Jul 7, 2024

java.lang.IllegalStateException: Command Framework has not been relocated correctly!
        at me.despical.commandframework.CommandFramework.checkRelocation(CommandFramework.java:174)
        at me.despical.commandframework.CommandFramework.<init>(CommandFramework.java:139)
        at com.kweezy.kwessentials.KwEssentials.onEnable(KwEssentials.java:10)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:382)
        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:285)
        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:267)
        at net.minecraft.server.v1_5_R3.MinecraftServer.j(MinecraftServer.java:310)
        at net.minecraft.server.v1_5_R3.MinecraftServer.e(MinecraftServer.java:289)
        at net.minecraft.server.v1_5_R3.MinecraftServer.a(MinecraftServer.java:249)
        at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:160)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:388)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(Unknown Source)

any reasons i should do this? how to supress it?

@Despical
Copy link
Owner

Despical commented Jul 7, 2024

You need to relocate CommandFramework to avoid conflicts with other plugin JARs. Here is how you can do it using Maven or Gradle:

Maven

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-shade-plugin</artifactId>
   <version>3.4.1</version>
   <executions>
      <execution>
         <phase>package</phase>
         <goals>
            <goal>shade</goal>
         </goals>
         <configuration>
            <relocations>
               <relocation>
                  <pattern>me.despical.commandframework</pattern>
                  <shadedPattern>your.package.here</shadedPattern>
               </relocation>
            </relocations>
         </configuration>
      </execution>
   </executions>
</plugin>

Gradle

plugins {
    id 'com.github.johnrengelman.shadow' version '7.1.2'
}

shadowJar {
    relocate 'me.despical.commandframework', 'your.package.here'
}

Alternative Way
Add -Dcommandframework.suppressrelocation=true to your command line. This should only be used for testing purposes and not for production.

@Despical Despical pinned this issue Jul 7, 2024
@KweezyCode
Copy link
Author

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants