Interesting shit?
0:00:00.209,0:00:03.760
Hi there! I'm Dinnerbone. I'm one of the lead developers for Bukkit
0:00:03.760,0:00:06.700
and today I'm going to make a complete fool out of myself
0:00:06.700,0:00:09.550
by giving you guys some video tutorials on how to get started
0:00:09.550,0:00:12.419
with creating your own Bukkit plugins.
0:00:12.419,0:00:16.740
For these tutorials, I'm going to assume you have a fair amount of knowledge of Java,
0:00:16.740,0:00:22.250
but hopefully shouldn't be too difficult for you to follow if you only have a limited amount.
0:00:22.250,0:00:25.390
I'll start fairly easy today with showing you how to make a simple plugin
0:00:25.390,0:00:28.509
that changes blocks underneath players as they walk by.
0:00:28.509,0:00:31.009
Hopefully, it will change the blocks into red wool,
0:00:31.009,0:00:34.050
kind of like a red carpet for VIPs.
0:00:34.050,0:00:38.820
To get started, you will want to use a tool that I made a few days called the pluginator.
0:00:38.820,0:00:41.400
It will make the skeleton for your plugin for you,
0:00:41.400,0:00:44.799
ready for you to just open up in your favorite editor and do your stuff.
0:00:44.799,0:00:48.700
First, you'll need to visit my website at dinnerbone.com
0:00:48.700,0:00:51.450
and hit plugin generator on the right.
0:00:51.450,0:00:54.780
It will give you this form that you can see here.
0:00:54.780,0:00:57.900
It might look a bit scary if this is your first time.
0:00:57.900,0:01:01.260
Don't worry. You only need to fill in three fields today.
0:01:01.260,0:01:03.690
The first one is "plugin name", which
0:01:03.690,0:01:04.730
we'll call
0:01:04.730,0:01:08.860
"Very Important People"
0:01:08.860,0:01:14.130
The second field is "author name" which is basically just your name.
0:01:14.130,0:01:18.190
You'll notice it filled in some fields for you.
0:01:18.190,0:01:20.520
The description isn't required,
0:01:20.520,0:01:22.700
so you can leave this out if you want to,
0:01:22.700,0:01:26.120
but I strongly recommend that you fill this in just so people know
0:01:26.120,0:01:33.120
what your plugin does.
0:01:36.420,0:01:40.460
As soon as you hit "generate", it should give you a zip file.
0:01:40.460,0:01:43.680
It contains the new source of your project.
0:01:43.680,0:01:50.680
First let's extract this somewhere.
0:01:53.270,0:01:55.620
If we open NetBeans,
0:01:55.620,0:01:58.880
we should be able to just open this folder as a project...
0:01:58.880,0:02:02.270
straight away...
0:02:02.270,0:02:05.700
and here we go. We have the project on the top left.
0:02:05.700,0:02:08.619
You'll see it's made just one class for you,
0:02:08.619,0:02:10.749
which extends JavaPlugin.
0:02:10.749,0:02:13.129
We call this the main plugin class.
0:02:13.129,0:02:16.829
Basically all the operations of your plugin go through this. This manages your complete
0:02:16.829,0:02:19.519
plugin for you.
0:02:19.519,0:02:21.780
If this is your first time making a plugin,
0:02:21.780,0:02:26.169
and it comes up with a lot of those squiggly lines saying "this is wrong", "this is wrong"
0:02:26.169,0:02:27.150
don't worry about it
0:02:27.150,0:02:32.179
just go over here, right click on dependencies and download dependencies.
0:02:32.179,0:02:33.999
You'll see it working online.
0:02:33.999,0:02:35.110
Basically,
0:02:35.110,0:02:38.470
because it's your first time it doesn't know what Bukkit is, it doesn't know how to do
0:02:38.470,0:02:40.889
all the stuff that you're going to do.
0:02:40.889,0:02:47.729
So it has to download all that, and then everything should look like it does now.
0:02:47.729,0:02:50.109
It also made one other file for you,
0:02:50.109,0:02:53.449
which we call the plugin description file,
0:02:53.449,0:02:56.449
and you don't have to really worry about this today, but you will have to come
0:02:56.449,0:02:57.839
back to this in the future.
0:02:57.839,0:03:00.569
This manages all the metadata about your plugin:
0:03:00.569,0:03:02.439
what the plugin actually is,
0:03:02.439,0:03:03.769
how Bukkit should run it.
0:03:03.769,0:03:07.450
Bukkit cannot run a plugin without this file.
0:03:07.450,0:03:12.009
We'll just ignore this for now.
0:03:12.009,0:03:13.960
Now, you'll see we've already got two methods
0:03:13.960,0:03:16.389
"onEnable" and "onDisable".
0:03:16.389,0:03:21.619
All it does is just print to the screen whenever the plugin is enabled or disabled.
0:03:21.619,0:03:26.469
If we compile the project by right clicking on it and "clean build"
0:03:26.469,0:03:28.729
(you'll see it working on the bottom)
0:03:28.729,0:03:32.469
Again, if this is your first time this might take a long time
0:03:32.469,0:03:34.219
because it has to download all the dependencies,
0:03:34.219,0:03:40.389
but otherwise it should be ready speedy after the first time.
0:03:40.389,0:03:43.609
Well there we go: Build success.
Not saying where i gots i but thoughts?