mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-28 08:24:25 +00:00
Added option to /fireball command: /fireball small
This commit is contained in:
parent
293f2f7cd2
commit
8c478c76a5
2 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue