diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ed71107..cf0eb95a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,25 @@ Having multiple developers work on the same issue will be just a waste of time a You should also try not to make any PRs before support is added when a new Minecraft version comes out even if it's unrelated to adding support for that version since your changes are likely to conflict with the update. +### Usage + +This project uses Maven. So you'll have to use `mvn` commands. +In IntelliJ, you can press `Ctrl` twice for the command window to popup. +To compile the library into `target` folder, you can use this Maven command: +```maven +mvn package +``` + +To test the library using the latest Spigot server, you can use: + +```maven +mvn clean package -Ptester,latest +``` + +> [!NOTE] +> The server files will be generated inside `target/tests` folder.\ +> The common server settings used between tests are in `src/test/resources` + ### Rules * One of the main principles of XSeries is that each utility should be independent except the ones that cannot be diff --git a/pom.xml b/pom.xml index af344827..9972f844 100644 --- a/pom.xml +++ b/pom.xml @@ -60,11 +60,11 @@ nms-repo https://repo.codemc.org/repository/nms/ - - - - - + + + + + @@ -75,20 +75,22 @@ 1.20.6-R0.1-SNAPSHOT + UTF-8 + UTF-8 - - - - - - - - - - - + + + + + + + + + + + org.spigotmc spigot @@ -105,7 +107,7 @@ org.junit.jupiter junit-jupiter - 5.8.2 + 5.10.2 test @@ -115,7 +117,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.3.1 attach-sources @@ -128,12 +130,13 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.7.0 none 8 - com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles + com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles + ${java.home}/bin/javadoc @@ -149,7 +152,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.2.4 sign-artifacts @@ -163,7 +166,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.7.0 true ossrh @@ -174,8 +177,9 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 + UTF-8 none 8 8 @@ -197,7 +201,7 @@ testCompile - true + @@ -205,16 +209,17 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.2.5 + false ${basedir}/target/tests - - - + + + - **/DummySpigot.java + **/*.java @@ -245,7 +250,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 21 21 @@ -260,7 +265,7 @@ false - */**DummySpigot.java + **/*.java diff --git a/src/main/java/com/cryptomorin/xseries/reflection/XReflection.java b/src/main/java/com/cryptomorin/xseries/reflection/XReflection.java index 77cfd5a1..e15d2815 100644 --- a/src/main/java/com/cryptomorin/xseries/reflection/XReflection.java +++ b/src/main/java/com/cryptomorin/xseries/reflection/XReflection.java @@ -274,8 +274,6 @@ public static VersionHandle v(int version, T handle) { } /** - * Overload for {@link #v(int, T)} that supports patch versions - * * @since 9.5.0 */ public static VersionHandle v(int version, int patch, T handle) { diff --git a/src/main/java/com/cryptomorin/xseries/reflection/jvm/classes/PackageHandle.java b/src/main/java/com/cryptomorin/xseries/reflection/jvm/classes/PackageHandle.java index 8e172a3b..f27b2e69 100644 --- a/src/main/java/com/cryptomorin/xseries/reflection/jvm/classes/PackageHandle.java +++ b/src/main/java/com/cryptomorin/xseries/reflection/jvm/classes/PackageHandle.java @@ -4,7 +4,7 @@ public interface PackageHandle { @Language("RegExp") - String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)+\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*"; + String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)*\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*"; @Language("RegExp") String JAVA_IDENTIFIER_PATTERN = "\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*"; diff --git a/src/main/java/com/cryptomorin/xseries/reflection/minecraft/MinecraftConnection.java b/src/main/java/com/cryptomorin/xseries/reflection/minecraft/MinecraftConnection.java index 7366c365..a3fcc17f 100644 --- a/src/main/java/com/cryptomorin/xseries/reflection/minecraft/MinecraftConnection.java +++ b/src/main/java/com/cryptomorin/xseries/reflection/minecraft/MinecraftConnection.java @@ -91,7 +91,6 @@ public static Object getConnection(@Nonnull Player player) { * * @param player the player to send the packet to. * @param packets the packets to send. - * @return the async thread handling the packet. * @since 1.0.0 */ @Nonnull diff --git a/src/test/DummySpigot.java b/src/test/DummySpigotTest.java similarity index 89% rename from src/test/DummySpigot.java rename to src/test/DummySpigotTest.java index ecf591fc..74485dca 100644 --- a/src/test/DummySpigot.java +++ b/src/test/DummySpigotTest.java @@ -3,10 +3,10 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; -public class DummySpigot extends DummyAbstractServer implements InvocationHandler { +public class DummySpigotTest extends DummyAbstractServer implements InvocationHandler { @Override protected InvocationHandler main() { - return new DummySpigot(); + return new DummySpigotTest(); } @Test diff --git a/src/test/TinyReflection.java b/src/test/TinyReflection.java index 46d53d7b..2326a7fc 100644 --- a/src/test/TinyReflection.java +++ b/src/test/TinyReflection.java @@ -23,7 +23,7 @@ public final class TinyReflection { static { String version = null; try { - version = Files.readAllLines(Paths.get(DummySpigot.class.getResource("version.txt").toURI())).get(0); + version = Files.readAllLines(Paths.get(DummySpigotTest.class.getResource("version.txt").toURI())).get(0); } catch (IOException | URISyntaxException e) { e.printStackTrace(); }