The /npc tpto command defaults from entity to selected NPC

This commit is contained in:
fullwall 2013-02-17 12:47:02 +08:00
parent a9bbf875eb
commit 580dd6a19e

View File

@ -1080,6 +1080,8 @@ public class NPCCommands {
@Requirements
public void tpto(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
Entity from = null, to = null;
if (npc != null)
from = npc.getBukkitEntity();
if (args.hasValueFlag("npc1")) {
NPC fromNPC = CitizensAPI.getNPCRegistry().getById(args.getFlagInteger("npc1"));
if (fromNPC != null)