From 8c478c76a51d53abc214d170294773377987fcac Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 20 Nov 2011 14:34:03 +0100 Subject: Added option to /fireball command: /fireball small --- .../src/com/earth2me/essentials/commands/Commandfireball.java | 8 +++++++- Essentials/src/plugin.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java index 0dc78474b..8bb172a29 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Fireball; +import org.bukkit.entity.SmallFireball; import org.bukkit.util.Vector; @@ -16,7 +17,12 @@ public class Commandfireball extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { + boolean small = false; + if (args.length > 0 && args[0].equalsIgnoreCase("small")) + { + small = true; + } final Vector direction = user.getEyeLocation().getDirection().multiply(2); - user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), Fireball.class); + user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), small ? SmallFireball.class : Fireball.class); } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index dcbbfe767..e3f500b9e 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -88,7 +88,7 @@ commands: aliases: [extinguish,eext,eextinguish] fireball: description: Throw a fireball. - usage: / + usage: / [small] aliases: [efireball] gamemode: description: Change player gamemode. -- cgit v1.2.3