mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-06-30 16:34:46 +02:00
Add -c flag to '/npc anchor --save anchor_name' to save location of the cursor.
This commit is contained in:
parent
b8878eda5d
commit
d6c6b3864f
|
@ -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
Loading…
Reference in New Issue
Block a user