branch | status | download |
---|---|---|
master | Download latest release (recommend) | |
development | Download snapshots |
JavaDocs: https://shynixn.github.io/Anchor-NMS/apidocs/
This project is no longer under active development.
AnchorNMS is a maven plugin which is designed to internally use the mod development framework ForgeGradle for mod development with Maven.
Compared to ForgeGradle it offers easy integration into any existing Multi Module Java Projects. Also, you can include it at any part of your build cycle as described below.
- Plugin goal to generate mcp libraries for 1.12, 1.11 and 1.10
- Plugin goal which automatically obfuscates your generated .jar file
- Multi version support in one Module as class paths get relocated and restored
The plugin is available in the central maven repository.
- Insert the following lines into your pom.xml.
<build>
<plugins>
<plugin>
<groupId>com.github.shynixn.anchornms</groupId>
<artifactId>anchornms-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<goals>
<goal>obfuscate-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<versions>
<version>1.12</version>
</versions>
</configuration>
</plugin>
</plugins>
</build>
-
Define your versions you want to generate and use.
-
Execute the following goal to generate your libraries.
mvn anchornms:generate-mcp-libraries
- After that, you can find the library files in your target/nms-tools folder called mcp-1.12.jar or mcp-any-version.jar
- Copy these library files anywhere on your pc or install it into your maven cache and include it into your project.
- Now you can use the classes for this version.
public void manipulateArmorstand() {
net.minecraft.anchor.v1_12_mcpR1.entity.item.EntityArmorStand armorStand;
armorStand.setSilent(true);
}
Make sure you have the plugin above included into your pom.xml.
The obfuscate goal gets automatically applied and is bound per default to the phase package.
mvn package
Congrats, the jar file is now correctly obfuscated.
Often you have to shade dependencies into your final jar file or even relocate them. This is fully supported as only your jar file in the target folder gets obfuscated by the obfuscation goal.
This means you can simply include the plugin after your shading plugin, so your shaded jar gets obfuscated in the end.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.shynixn.anchornms</groupId>
<artifactId>anchornms-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<goals>
<goal>obfuscate-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<versions>
<version>1.12</version>
</versions>
</configuration>
</plugin>
</plugins>
</build>
You can optionally define the input jar file which gets obfuscated and the output jar file.
<build>
<plugins>
<plugin>
<groupId>com.github.shynixn.anchornms</groupId>
<artifactId>anchornms-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<goals>
<goal>obfuscate-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<inputFile>SomePath/MyJar.jar</inputFile>
<outputFile>SomePath/MyFinalJar.jar</outputFile>
<versions>
<version>1.12</version>
</versions>
</configuration>
</plugin>
</plugins>
</build>
Copyright 2018 Shynixn
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.