-
Notifications
You must be signed in to change notification settings - Fork 7
Getting Started
TODO: The following information is out of date. Aero no longer needs to be added to the classpath.
Aero has to be added to the classpath at compile-time for it to function. Adding in Aero classes varies per setup. Below are how-to guides for the two most common setups.
Create a Maven project if you don't have one already, and open up the project pom.xml file (either through an IDE or with your favorite editor. BukkitLib is included in the Central Repository so you don't need to add in a custom repository. Also, Javadocs and source are available through the repository. So you've got that going for you, which is nice.
<dependencies>
...
<dependency>
<groupId>net.pravian</groupId>
<artifactId>BukkitLib</artifactId>
<version>1.3</version>
<scope>compile</scope>
</dependency>
...
</dependencies>Now that the dependency is set up, we have to ensure BukkitLib gets added to the classpath so it is available at runtime. The easiest way to achieve this is using the maven-shade plugin. Add in the plugin like this.
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>net.pravian:BukkitLib</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>If you haven't already, create a project and name it anything you like. Now browse to the project directory and open the file build.xml Scroll all the way to the very last section. And copy-paste this piece of code just above </project>.
<target name="-post-jar">
<echo level="info" message="---- Finalizing Build" />
<!-- Rename unmapped (no libaries) .jar file -->
<copy file="${dist.jar}" tofile="${dist.dir}/${ant.project.name}-unmapped.jar" />
<delete file="${dist.dir}/${ant.project.name}.jar" />
<!-- Generate mapped (with libraries) .jar file -->
<jar compress="${jar.compress}" destfile="${dist.jar}">
<zipfileset src="${dist.dir}/${ant.project.name}-unmapped.jar" excludes="META-INF/*" />
<zipgroupfileset dir="${dist.dir}/lib/" includes="BukkitLib*" />
<manifest>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
<!-- Delete /dist/README.txt -->
<delete file="${dist.dir}/README.TXT" />
<!-- Delete /dist/lib folder -->
<delete dir="${dist.dir}/lib/" />
<echo level="info" message="---- Done" />
</target>This code snippet does three things:
- Cleans up the /dist folder where your plugin archives are located.
- Adds any dependency starting with BukkitLib to the classpath.
- Keeps a copy of the unmapped (without any added dependencies) archive as /dist/[projectname]-unmapped.jar Of course, feel free to modify and tweak to your likings.
Now, BukkitLib should be copied to the classpath. But before we can start hacking into the heart of our project, we need to download BukkitLib and add it as an dependency.
Firstly, download the latest version of BukkitLib here. Now, start up NetBeans and open your project. From the top menu click on File and from the submenu, select Project Properties. From the properties window which will appear, navigate to Libraries. Click on Add Library. From here, you can create a new library for BukkitLib. Make sure the name of the library starts with BukkitLib (For example: BukkitLib-1.3.jar) so that it will be added to the classpath at compile time. It is suggested that you also add the BukkitLib Javadoc to the library under the Javadoc tab. You can also use the remote Javadoc URL: http://bukkitlib.pravian.net.
Currently, Compiling with Eclipse is not supported. This is due to it being very difficult to bundle specific jar files in your export. Eclipse does support Maven, so you could use that instead.
BukkitLib has three ways to attach Javadocs to a project. The first being through Maven. The second being a direct download through BukkitLib's Releases. Finally, online JavaDocs are available here.
Previous: Home Next: Extending BukkitPlugin
Aero is not affiliated with Bukkit or Mojang in any way. All rights belong to their respective owners.
- Home
- About
- Tutorial
- Getting Started
- Extending BukkitPlugin
- Logging with BukkitLogger
- Config Handling
- Handling Commands
- Utility Classes
- Implementations
- Using Metrics - mcstats.org
- Concurrency
- Proxy Classes
- Serializable Objects
- The BukkitLib class
- Example projects
- Online Javadocs
- BukkitDev Page
- Changelogs
- Credits