The Meaning of Life, the Universe, and Everything.
Join Date:
3/29/2014
Posts:
66
Location:
KWIK WHO'S DAT BEHIND YOU?
Member Details
Hey guys! Have you ever noticed that there aren't really any updated or helpful tutorials for SpoutPlugin development? Well, this tutorial goes over everything you'll need to make your very own Spout plugin!
#1: Setting Up
In order to start with Spout, you need to have a bukkit workspace set up. If you don't, use this tutorial.
When you are setting up your bukkit workspace, make sure to add the spoutcraftplugin as a library.
In the pom.xml, go down to repositories, and add in this:
-
View User Profile
-
View Posts
-
Send Message
Curse Premium#1: Setting Up
In order to start with Spout, you need to have a bukkit workspace set up. If you don't, use this tutorial.
When you are setting up your bukkit workspace, make sure to add the spoutcraftplugin as a library.
In the pom.xml, go down to repositories, and add in this:
Now go to dependencies, and add in this:
<dependency> <groupId>org.getspout</groupId> <artifactId>spoutplugin</artifactId> <version>${spoutplugin.version}</version> <scope>provided</scope> </dependency>#2: Our first block
In your plugin's main class:
Before onEnable, put in this line of code:
Inside onEnable:
Now, create a class called BlockTutBlock that extends GenericCustomBlock. Inside it, paste this code:
public BlockTutBlock(Plugin plugin, Texture texture) { super(plugin, "TutBlock", 1, new GenericCubeBlockDesign(plugin, texture, 0)); }Replace "TutBlock" with whatever the block's label should display.
To set the hardness, put this inside BlockTutBlock, under the super:
Change 0.0 to whatever the hardness value should be.
There are a few other things you can add, such as:
and
You have created your first custom block!
#3: Texturing
In your plugin's main class:
Before onEnable:
Put in this code:
Inside onEnable:
Put in this code:
#4: Our first item
In your plugin's main class, before onEnable, put in this code:
Inside onEnable, put this in:
Now, create a new class called ItemTutItem that extends GenericCustomItem, and insert this code:
public ItemTutItem(Plugin plugin, Texture texture) { super(plugin, "TutItem"); }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI'm working on an open-source mod called Craft++. Check it out!