Solved NMS refuses to work for some reason

Discussion in 'Spigot Plugin Development' started by TheDiamondPicker, Dec 25, 2020.

  1. Notes before I get started:
    • I'm on Mac.
    • I tried rebuilding with build tools and replacing the jar in ~/.m2/org/spigotmc/spigot/1.8.8-R0.1-SNAPSHOT
    • I decompiled the jar and made sure it had NMS in it.
    • @Creeprr tried to help me on discord but to no avail.
    • mvn compile in all 3 SpigotMC, spigot and 1.8.8 gave this error: https://hastebin.com/soyeludufa.css
    • Here's the code I used for build tools:
      Code (Text):
      export MAVEN_OPTS="-Xmx2G"
      java -Xmx2G -jar BuildTools.jar --rev 1.8.8
    • And here's my pom.xml:
      Code (XML):
      <?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">
          <modelVersion>4.0.0</modelVersion>

          <groupId>me.vomet</groupId>
          <artifactId>Utils</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>jar</packaging>

          <name>Utils</name>

          <properties>
              <java.version>1.8</java.version>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          </properties>

          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>3.8.1</version>
                      <configuration>
                          <source>${java.version}</source>
                          <target>${java.version}</target>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-shade-plugin</artifactId>
                      <version>3.2.4</version>
                      <executions>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>shade</goal>
                              </goals>
                              <configuration>
                                  <createDependencyReducedPom>false</createDependencyReducedPom>
                              </configuration>
                          </execution>
                      </executions>
                  </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>
          </repositories>

          <dependencies>
              <dependency>
                  <groupId>org.spigotmc</groupId>
                  <artifactId>spigot-api</artifactId>
                  <version>1.8.8-R0.1-SNAPSHOT</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.spigotmc</groupId>
                  <artifactId>spigot</artifactId>
                  <version>1.8.8-R0.1-SNAPSHOT</version>
                  <scope>provided</scope>
              </dependency>
          </dependencies>
      </project>
       
    So as you might've been able to tell, NMS is refusing to work. I don't know why, but I was recommended to seek help here.

    I also get this error in the pom.xml:

    Thanks for the help in advance!
     
  2. Try having only the spigot dependency (remove spigot-api).
    Also, you forgot to post the error that you're getting.
     
  3. I'll try that now.
    I could swear I put the screenshot, I'll paste it here.
    upload_2020-12-25_21-24-52.png

    EDIT: Didn't work
     
    #3 TheDiamondPicker, Dec 25, 2020
    Last edited: Dec 25, 2020
  4. If you want to use NMS, you need the Spigot server jar, not the Spigot API. In order to do that, run BuildTools/Download from somewhere and add dependency as an external jar from project structure.
     
  5. You would need to inport craftbukkit


    Code (Text):
    <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>craftbukkit</artifactId>
                <version>1.8.8-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
     
  6. that doesn't work.
     
  7. It only works if you had buildtools installed