Adds a tag for the player name that clicks the sign

Can be used in the commands that get executed when someone clicks an
AreaShop sign. Tag is %clicker%
This commit is contained in:
Thijs Wiefferink 2014-11-24 12:58:31 +01:00
parent 4125364a96
commit 1fd24d864d
3 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,7 @@ limitGroups:
## %depth% The depth of the region (amount of blocks on the z-axis) ## %depth% The depth of the region (amount of blocks on the z-axis)
## %height% The height of the region (amount of blocks on the y-axis) ## %height% The height of the region (amount of blocks on the y-axis)
## %timeleft% The time left on the rent (uses the unit of time that fits best, minutes used from 121 seconds till 120 minutes) ## %timeleft% The time left on the rent (uses the unit of time that fits best, minutes used from 121 seconds till 120 minutes)
## %clicker% The name of the player that clicked the sign (only to be used in the signProfiles section)
## Below are profiles for the signs, you can assign profiles to regions ## Below are profiles for the signs, you can assign profiles to regions
## by setting 'general.signProfile' in default.yml, groups or individual regions ## by setting 'general.signProfile' in default.yml, groups or individual regions

View File

@ -71,6 +71,7 @@ public final class AreaShop extends JavaPlugin {
public static final String tagHeight = "%height%"; // y-axis public static final String tagHeight = "%height%"; // y-axis
public static final String tagDepth = "%depth%"; // z-axis public static final String tagDepth = "%depth%"; // z-axis
public static final String tagTimeLeft = "%timeleft%"; public static final String tagTimeLeft = "%timeleft%";
public static final String tagClicker = "%clicker%";
public static AreaShop getInstance() { public static AreaShop getInstance() {
return AreaShop.instance; return AreaShop.instance;

View File

@ -1855,6 +1855,9 @@ public abstract class GeneralRegion {
continue; continue;
} }
command = applyAllReplacements(command); command = applyAllReplacements(command);
if(sender instanceof Player) {
command = command.replace(AreaShop.tagClicker, sender.getName());
}
boolean result = false; boolean result = false;
String error = null; String error = null;