Solved help with packet

Discussion in 'Spigot Plugin Development' started by FavioFlashMc, Jun 11, 2021.

Thread Status:
Not open for further replies.
  1. Hello. I have read the post from 1.17 and I have tried to use packages with maven but I can't
    I have not used maven before therefore I do not understand well.

    [​IMG]
    [​IMG]
    and 1_17?. Thanks for the help

    HTML:
    <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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>ReviveMe2</groupId>
      <artifactId>ReviveMe2</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </plugin>
          <plugin>
        <groupId>net.md-5</groupId>
        <artifactId>specialsource-maven-plugin</artifactId>
        <version>1.2.2</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>remap</goal>
                </goals>
                <id>remap-obf</id>
                <configuration>
                    <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                    <reverse>true</reverse>
                    <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                    <remappedArtifactAttached>true</remappedArtifactAttached>
                    <remappedClassifierName>remapped-obf</remappedClassifierName>
                </configuration>
            </execution>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>remap</goal>
                </goals>
                <id>remap-spigot</id>
                <configuration>
                    <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                    <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                    <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                </configuration>
            </execution>
        </executions>
    </plugin>
        </plugins>
      </build>
      <dependencies>
          <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>1.17-R0.1-SNAPSHOT</version>
        <classifier>remapped-mojang</classifier>
        <scope>provided</scope>
    </dependency>
      </dependencies>
    </project>
     
     
  2. Not quite sure what your issue is but going off the provided images you are trying to use NMS for 1.17.
    There are some developer notes for 1.17 that state major changes regarding the packages for net.minecraft, while updating my plugins I have noticed that net.minecraft no longer uses a version increment rather it is now set up completely differently.

    For example;
    This is 1.16 for referencing the Packet class;
    Code (Text):
    net.minecraft.server.v1_16_R3.Packet
    This is 1.17 for referencing the Packet class;
    Code (Text):
    net.minecraft.network.protocol.Packet
    As you can see the directory has completely changed and no longer requires a version increment.
    Theoretically, this would mean some things may not break when updating to say Minecraft 1.18+ in the future, reducing the need for Reflections.

    At the moment, unless someone else can chime in, I am unable to find any specific java docs referencing the new net.minecraft changes so I ended up discovering these changes by opening the spigot.jar file in a file manager.

    Hopefully that answers your question, its quite late so I may have completely miss understood haha.
     
    • Winner Winner x 1
  3. Thank you very much for the reply. I've been snooping around spigot.jar and I've seen the new libraries haha. I'm sorry I didn't mark the post as resolved. also thank you very much for everything and good luck!
     
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.