NBT-API

NBT-API

98.9k Downloads

It shows that the NBTAPI package has not been moved although from what I see I DID move it according to what the guide said... (Shading The Plugin Problem)

MSitiSoftware opened this issue ยท 6 comments

commented

Here's what I added and what is currently written in my pom.xml file that I guess is supposedly related to the NBTAPI shading:
This in :

<plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-shade-plugin</artifactId>
       <version>3.6.0</version>
       <executions>
         <execution>
           <id>shade</id>
           <phase>package</phase>
           <goals>
             <goal>shade</goal>
           </goals>
         </execution>
       </executions>
       <configuration>
         <relocations>
           <relocation>
             <pattern>de.tr7zw.changeme.nbtapi</pattern>
             <shadedPattern>me.negai.wanddesigner.nbtapi</shadedPattern>
           </relocation>
         </relocations>
       </configuration>
  </plugin>

And this in dependencies:

<dependency>
      <groupId>de.tr7zw</groupId>
      <artifactId>item-nbt-api</artifactId>
      <version>2.13.1</version>
    </dependency>

And this on onEnable method in the plugin's main class:

        @Override
	public void onEnable() {
		if (!NBT.preloadApi()) {
	            getLogger().warning("NBT-API wasn't initialized properly, disabling the plugin");
	            getPluginLoader().disablePlugin(this);
	            return;
	        }
         }

Here is what it showed in the logs
image

commented

Correct. That means it didn't work/run. Check the output when running the mvn clean install command.

I succeeded in fixing this, thank you so much for helping!

commented

Look inside the jar, also do you actually build with maven and not the ide?

commented

Look inside the jar, also do you actually build with maven and not the ide?

What do you mean by looking inside the jar?
And no I don't build with the IDE I build it with maven can it be the problem that causes this?

commented

Look inside the jar if it is actually relocated or not. Like the actual file paths.

commented

Look inside the jar if it is actually relocated or not. Like the actual file paths.

image
Oh I think now I see, there are 2 packages here, me.negai.wanddesigner (my package) and de.tr7zw.changeme.nbtapi... I guess it means it wasn't relocated right?

commented

Correct. That means it didn't work/run. Check the output when running the mvn clean install command.