Saturday, February 19, 2011

Getting Started With Bukkit Plugin Development

Getting started with Bukkit plugin programming can seem daunting- but if you follow these instructions, to the letter, you should be able to get yourself set up and ready to go!

Before you start: Check out the bukkit wiki first, look in the "Getting Started" section.... I'm going to be updating that instead! This page will stay around for now, for Persistence and Gameplay tutorials.

Contents
Tools
Getting Eclipse Set Up
Donwloading Eclipse Plugins

Tools
This tutorial uses the following technology:

  • Eclipse - get the latest version, for Java devs
  • git - I recommend that you use git for version control, even if just locally
  • EGit - an Eclipse plugin for easy git use, available in the Eclipse Marketplace
  • github.com - It's a good idea to get a github account, and I recommend you go open source!
  • Maven - Maven is a dependency management and build system
  • Eclipse Plugin for Maven - Integrates Maven into Eclipse

If you prefer other tools/environments, you're going to be somewhat on your own, but this tutorial may still be useful.

Getting Eclipse Set Up
Start by downloading Eclipse. This is the only thing you should need to download directly- install it and get it started. Set up a "workspace"- this just a folder where you'll keep your code. Check the "use this as default and don't ask again" box:


Now, you should get a welcome screen like this:


You can close the "Welcome" tab using the "x" or explore what it has to offer if you're a first-time Eclipse user. Eclipse is a very powerful IDE- you will get to learn it over the course of this tutorial, but it's worth you time to explore what's there.

When you're ready, close the "Welcome" tab and you should see the default Eclipse IDE:


Don't feel overwhelmed! Let's take some time to introduce you to Eclipse, step-by-step. Eclipse is a flexible UI framework, it has two main concepts:

Views
A "view" in eclipse is like a sub-window. Every tab that you see on the screen is a "view". You can access any view at any time using "Window", "Show View":


Eclipse has a lot of views, and plugins can add them, as well. This list is mean to contain the most commonly used ones.

Perspectives
A perspective in Eclipse is just a set of views, arranged a certain way. Eclipse comes with some default perspectives- the one you see in front of you is the "Java" perspective, which you can see in the top-right:

 You can have as many different perspectives "open" at one time, and switch between then using these controls. You may also customize any perspective- adding views, toolbar buttons, etc, as you see fit.

The Java Perspective
The default views available in the Java perspective should be as follows:



Download Eclipse Plugins
Eclipse has a built-in "marketplace" for plugins (think "Fill"). Access it via "Help" menu:


No comments:

Post a Comment