Add -c flag to '/npc anchor --save anchor_name' to save location of the cursor.

This commit is contained in:
Jeremy Schroeder 2012-12-27 22:28:39 -05:00
parent b8878eda5d
commit d6c6b3864f
2 changed files with 1290 additions and 1272 deletions

View File

@ -206,6 +206,16 @@ public class CommandContext {
return location;
}
public Location getSenderTargetBlockLocation() {
if (location != null || sender == null)
return location;
if (sender instanceof Player)
location = ((Player) sender).getTargetBlock(null, 50).getLocation();
else if (sender instanceof BlockCommandSender)
location = ((BlockCommandSender) sender).getBlock().getLocation();
return location;
}
public String[] getSlice(int index) {
String[] slice = new String[args.length - index];
System.arraycopy(args, index, slice, 0, args.length - index);

File diff suppressed because it is too large Load Diff