From efaed85188bb5515e2d88fdaf761e3f841bbba70 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 23 Jun 2011 14:14:24 +0200 Subject: [PATCH] New command /fireball --- .../essentials/commands/Commandfireball.java | 24 +++++++++++++++++++ Essentials/src/plugin.yml | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandfireball.java diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java new file mode 100644 index 000000000..73c314935 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java @@ -0,0 +1,24 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.User; +import org.bukkit.Server; +import org.bukkit.entity.Fireball; +import org.bukkit.util.Vector; + + +public class Commandfireball extends EssentialsCommand +{ + + public Commandfireball() + { + super("fireball"); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + charge(user); + final Vector direction = user.getEyeLocation().getDirection().multiply(2); + user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), Fireball.class); + } +} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 6c26d8cb2..68a7b8b30 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -76,6 +76,10 @@ commands: description: Extinguish players. usage: / aliases: [extinguish] + fireball: + description: Throw a fireball. + usage: / + aliases: [efireball] getpos: description: Get your current coordinates. usage: /