mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-06-28 15:35:02 +02:00
Fix CITIZENS-191
This commit is contained in:
parent
892e9f6f59
commit
794d78a264
|
@ -71,6 +71,7 @@ public class Settings {
|
|||
},
|
||||
LOCALE("general.translation.locale", "en"),
|
||||
MAX_NPC_LIMIT_CHECKS("npc.limits.max-permission-checks", 100),
|
||||
MAX_SPEED("npc.limits.max-speed", 100),
|
||||
NPC_COST("economy.npc.cost", 100D),
|
||||
QUICK_SELECT("npc.selection.quick-select", false),
|
||||
REMOVE_PLAYERS_FROM_PLAYER_LIST("npc.player.remove-from-list", true),
|
||||
|
|
|
@ -592,7 +592,9 @@ public class NPCCommands {
|
|||
max = 2,
|
||||
permission = "npc.speed")
|
||||
public void speed(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
float newSpeed = (float) args.getDouble(1);
|
||||
float newSpeed = (float) Math.abs(args.getDouble(1));
|
||||
if (newSpeed >= Setting.MAX_SPEED.asDouble())
|
||||
throw new CommandException("Speed is above the limit.");
|
||||
npc.getNavigator().getDefaultParameters().speedModifier(newSpeed);
|
||||
|
||||
Messaging.sendF(sender, ChatColor.GREEN + "NPC speed modifier set to %s.",
|
||||
|
|
Loading…
Reference in New Issue
Block a user