mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Must be spawned for /npc equip
This commit is contained in:
parent
d76841c319
commit
5087ffb4bf
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import net.citizensnpcs.api.command.Command;
|
||||
import net.citizensnpcs.api.command.CommandContext;
|
||||
import net.citizensnpcs.api.command.Requirements;
|
||||
import net.citizensnpcs.api.command.exception.CommandException;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.editor.CopierEditor;
|
||||
import net.citizensnpcs.editor.Editor;
|
||||
@ -35,7 +36,9 @@ public class EditorCommands {
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "citizens.npc.edit.equip")
|
||||
public void equip(CommandContext args, Player player, NPC npc) {
|
||||
public void equip(CommandContext args, Player player, NPC npc) throws CommandException {
|
||||
if (!npc.isSpawned())
|
||||
throw new CommandException("NPC must be spawned");
|
||||
Editor.enterOrLeave(player, new EquipmentEditor(player, npc));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user