mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-28 05:35:45 +01:00
Make /npc speed modify the speed as a percentage
This commit is contained in:
parent
32008a178d
commit
a0573c8997
@ -545,16 +545,16 @@ public class NPCCommands {
|
|||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
aliases = { "npc" },
|
||||||
usage = "speed [speed]",
|
usage = "speed [speed]",
|
||||||
desc = "Sets the movement speed of an NPC",
|
desc = "Sets the movement speed of an NPC as a percentage",
|
||||||
modifiers = { "speed" },
|
modifiers = { "speed" },
|
||||||
min = 2,
|
min = 2,
|
||||||
max = 2,
|
max = 2,
|
||||||
permission = "npc.speed")
|
permission = "npc.speed")
|
||||||
public void speed(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
public void speed(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
float newSpeed = (float) args.getDouble(1);
|
float newSpeed = (float) args.getDouble(1);
|
||||||
npc.getNavigator().getDefaultParameters().speed(newSpeed);
|
npc.getNavigator().getDefaultParameters().speedModifier(newSpeed);
|
||||||
|
|
||||||
Messaging.sendF(sender, ChatColor.GREEN + "NPC speed set to %f.", newSpeed);
|
Messaging.sendF(sender, ChatColor.GREEN + "NPC speed modifier set to %f.", newSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Loading…
Reference in New Issue
Block a user