Updated the 'senderMustBePlayer' attribute of all commands.
This commit is contained in:
parent
f09b90f0a6
commit
26e5b68a7d
@ -13,37 +13,25 @@ import de.craftinc.gates.util.TextUtil;
|
|||||||
|
|
||||||
public abstract class BaseCommand
|
public abstract class BaseCommand
|
||||||
{
|
{
|
||||||
protected List<String> aliases;
|
protected List<String> aliases = new ArrayList<String>();
|
||||||
protected List<String> requiredParameters;
|
protected List<String> requiredParameters = new ArrayList<String>();
|
||||||
protected List<String> optionalParameters;
|
protected List<String> optionalParameters = new ArrayList<String>();
|
||||||
|
|
||||||
protected String helpDescription;
|
protected String helpDescription = "no description";
|
||||||
|
|
||||||
protected List<String> parameters;
|
protected List<String> parameters;
|
||||||
protected CommandSender sender;
|
protected CommandSender sender;
|
||||||
protected Player player;
|
protected Player player;
|
||||||
protected Gate gate;
|
protected Gate gate;
|
||||||
|
|
||||||
protected boolean senderMustBePlayer;
|
protected boolean senderMustBePlayer = true;
|
||||||
protected boolean hasGateParam;
|
protected boolean hasGateParam = true;
|
||||||
|
|
||||||
protected String requiredPermission;
|
protected String requiredPermission;
|
||||||
protected boolean needsPermissionAtCurrentLocation;
|
protected boolean needsPermissionAtCurrentLocation;
|
||||||
|
|
||||||
protected boolean shouldPersistToDisk;
|
protected boolean shouldPersistToDisk;
|
||||||
|
|
||||||
|
|
||||||
public BaseCommand()
|
|
||||||
{
|
|
||||||
aliases = new ArrayList<String>();
|
|
||||||
requiredParameters = new ArrayList<String>();
|
|
||||||
optionalParameters = new ArrayList<String>();
|
|
||||||
|
|
||||||
senderMustBePlayer = true;
|
|
||||||
hasGateParam = true;
|
|
||||||
|
|
||||||
helpDescription = "no description";
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAliases() {
|
public List<String> getAliases() {
|
||||||
return aliases;
|
return aliases;
|
||||||
|
@ -21,6 +21,8 @@ public class CommandClose extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@ public class CommandCreate extends BaseLocationCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = true;
|
needsPermissionAtCurrentLocation = true;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
|
||||||
|
senderMustBePlayer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ public class CommandDelete extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ public class CommandHelp extends BaseCommand
|
|||||||
hasGateParam = false;
|
hasGateParam = false;
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = false;
|
shouldPersistToDisk = false;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ public class CommandInfo extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = false;
|
shouldPersistToDisk = false;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public class CommandList extends BaseCommand
|
|||||||
|
|
||||||
requiredPermission = Plugin.permissionInfo;
|
requiredPermission = Plugin.permissionInfo;
|
||||||
shouldPersistToDisk = false;
|
shouldPersistToDisk = false;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ public class CommandOpen extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ public class CommandRename extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ public class CommandSetExit extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = true;
|
needsPermissionAtCurrentLocation = true;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ public class CommandSetHidden extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ public class CommandSetLocation extends BaseLocationCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = true;
|
needsPermissionAtCurrentLocation = true;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ public class CommandSetVisible extends BaseCommand
|
|||||||
|
|
||||||
needsPermissionAtCurrentLocation = false;
|
needsPermissionAtCurrentLocation = false;
|
||||||
shouldPersistToDisk = true;
|
shouldPersistToDisk = true;
|
||||||
|
senderMustBePlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user