diff options
author | snowleo <schneeleo@gmail.com> | 2012-03-02 01:30:52 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-03-02 01:30:52 +0100 |
commit | c065247881b7ca27e88819392056bb0fe8622486 (patch) | |
tree | 359a70a39466204bfcd3254b5422cc91f70369d7 | |
parent | e0829dc831fbbd258c85be25886533d93c99ddc5 (diff) | |
download | Essentials-c065247881b7ca27e88819392056bb0fe8622486.tar Essentials-c065247881b7ca27e88819392056bb0fe8622486.tar.gz Essentials-c065247881b7ca27e88819392056bb0fe8622486.tar.lz Essentials-c065247881b7ca27e88819392056bb0fe8622486.tar.xz Essentials-c065247881b7ca27e88819392056bb0fe8622486.zip |
Will be removed until the next release XD
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java | 44 | ||||
-rw-r--r-- | Essentials/src/plugin.yml | 3 |
2 files changed, 47 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java new file mode 100644 index 000000000..3d9846923 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -0,0 +1,44 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.Mob; +import com.earth2me.essentials.User; +import java.util.Random; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.entity.Ocelot; + + +public class Commandkittycannon extends EssentialsCommand +{ + private static Random random = new Random(); + + public Commandkittycannon() + { + super("kittycannon"); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + final Mob cat = Mob.OCELOT; + final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation()); + if (ocelot == null) + { + return; + } + final int i = random.nextInt(Ocelot.Type.values().length); + ocelot.setCatType(Ocelot.Type.values()[i]); + ocelot.setTamed(true); + ocelot.setVelocity(user.getEyeLocation().getDirection().multiply(2)); + ess.scheduleSyncDelayedTask(new Runnable() + { + @Override + public void run() + { + final Location loc = ocelot.getLocation(); + ocelot.remove(); + loc.getWorld().createExplosion(loc, 1f); + } + }, 20); + } +} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 9165febb2..e63f8b758 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -186,6 +186,9 @@ commands: description: Kill all mobs in a world. usage: /<command> [mobType] [radius] aliases: [ekillall,butcher,ebutcher] + kittycannon: + description: Throw an exploding kitten at your opponent + usage: /<command> list: description: List all online players. usage: /<command> |