mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-21 07:32:07 +01:00
Added option to /fireball command: /fireball small
This commit is contained in:
parent
293f2f7cd2
commit
8c478c76a5
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
|||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Fireball;
|
import org.bukkit.entity.Fireball;
|
||||||
|
import org.bukkit.entity.SmallFireball;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
|
||||||
@ -16,7 +17,12 @@ public class Commandfireball extends EssentialsCommand
|
|||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
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);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ commands:
|
|||||||
aliases: [extinguish,eext,eextinguish]
|
aliases: [extinguish,eext,eextinguish]
|
||||||
fireball:
|
fireball:
|
||||||
description: Throw a fireball.
|
description: Throw a fireball.
|
||||||
usage: /<command>
|
usage: /<command> [small]
|
||||||
aliases: [efireball]
|
aliases: [efireball]
|
||||||
gamemode:
|
gamemode:
|
||||||
description: Change player gamemode.
|
description: Change player gamemode.
|
||||||
|
Loading…
Reference in New Issue
Block a user