tr7zw / Item-NBT-API

Add custom NBT tags to Items/Tiles/Entities without NMS!
https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/
MIT License
561 stars 77 forks source link

Wrong version? #295

Open KiwoNtV opened 2 months ago

KiwoNtV commented 2 months ago

The current version of the maven-shade-plugin as the nbt-api don't work for me as they just get marked red as well as the groupId 'de.tr7zw' and the artifactId 'item-nbt-api'. Need some help there please. I'm coding with IntelliJ Spigot Maven API 1.20.

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>de.naraku</groupId>
<artifactId>MWScoreboard</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>MWScoreboard</name>

<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version> <!-- Neueste Version -->
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>
        <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>de.naraku.mwscoreboard.PlayerDataManager</shadedPattern>
                    </relocation>
                </relocations>
            </configuration>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
</build>

<repositories>
    <repository>
        <id>spigotmc-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>sonatype</id>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
    <repository>
        <id>codemc-repo</id>
        <url>https://repo.codemc.io/repository/maven-public/</url>
        <layout>default</layout>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.20.4-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>de.tr7zw</groupId>
        <artifactId>item-nbt-api</artifactId>
        <version>2.13.2</version>
    </dependency>
</dependencies>

image image

tr7zw commented 2 months ago

You are missing the repo

KiwoNtV commented 2 months ago

What? It's right there isn't it?

I pasted this:

</repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.io/repository/maven-public/</url>
    <layout>default</layout>
</repository>
tr7zw commented 2 months ago

Then its an issue with your IDE. Never trust the IDE, use actual maven to run a clean install and it should work.