mirror of
https://github.com/NLthijs48/AreaShop.git
synced 2025-02-21 14:22:12 +01:00
Make profile based settings easier to understand
- Remove 'signProfiles', 'flagProfiles', 'eventCommandProfiles', 'schematicProfiles' and 'expirationWarningProfiles' from the config.yml file - Add the removed profile contents directly to the setting without the trailing 's' in the default.yml file (this prevents the need to understand the creation of profiles, and then assigning them, taking out a step in the thought process of users) - Added method in GeneralRegion to get a ConfigurationSection from the region file, group files or default file while also taking into account the translation from a string to a profile that is defined in the config.yml file. This ensures backwards compatibility with current config files (the old style will not be promoted anymore though). - The 'expirationWarningProfiles' does not have the subkeys 'warnPlayer' and 'commands' anymore, it is just a list of commands now, using the '/areashop message' command to warn a player. - Add a workaround for the empty sign problem after unrent/sell of a region while having restore enabled, an AsyncWorldEdit plugin installed and signs inside the region (sign will be updated again half a second after unrent/sell).
This commit is contained in:
parent
fcdfdc6094
commit
1ba2e21ae9
@ -365,11 +365,7 @@ public class InfoCommand extends CommandAreaShop {
|
||||
}
|
||||
// Restoring
|
||||
if(rent.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, Message.fromKey("info-regionRestoringProfile").replacements(rent.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, "");
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent);
|
||||
}
|
||||
// Restrictions
|
||||
if(!rent.isRented()) {
|
||||
@ -444,11 +440,7 @@ public class InfoCommand extends CommandAreaShop {
|
||||
}
|
||||
// Restoring
|
||||
if(buy.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, Message.fromKey("info-regionRestoringProfile").replacements(buy.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, "");
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy);
|
||||
}
|
||||
// Restrictions
|
||||
if(!buy.isSold()) {
|
||||
|
@ -206,12 +206,12 @@ public class SignsFeature extends Feature {
|
||||
region.setSetting("general.signs."+key, null);
|
||||
}
|
||||
|
||||
public String getProfile() {
|
||||
String profile = region.getConfig().getString("general.signs."+key+".profile");
|
||||
if(profile == null || profile.length() == 0) {
|
||||
profile = region.getStringSetting("general.signProfile");
|
||||
}
|
||||
return profile;
|
||||
/**
|
||||
* Get the ConfigurationSection defining the sign layout
|
||||
* @return The sign layout config
|
||||
*/
|
||||
public ConfigurationSection getProfile() {
|
||||
return region.getConfigurationSectionSetting("general.signProfile", "signProfiles", region.getConfig().get("general.signs."+key+".profile"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -222,72 +222,80 @@ public class SignsFeature extends Feature {
|
||||
if(region.isDeleted()) {
|
||||
return false;
|
||||
}
|
||||
YamlConfiguration config = region.getConfig();
|
||||
// Get the prefix
|
||||
String prefix = "signProfiles."+getProfile()+"."+region.getState().getValue().toLowerCase()+".";
|
||||
|
||||
YamlConfiguration regionConfig = region.getConfig();
|
||||
ConfigurationSection signConfig = getProfile();
|
||||
Block block = getLocation().getBlock();
|
||||
if(signConfig == null || !signConfig.isSet(region.getState().getValue())) {
|
||||
block.setType(Material.AIR);
|
||||
return true;
|
||||
}
|
||||
|
||||
ConfigurationSection stateConfig = signConfig.getConfigurationSection(region.getState().getValue());
|
||||
|
||||
// Get the lines
|
||||
String[] signLines = new String[4];
|
||||
signLines[0] = plugin.getConfig().getString(prefix+"line1");
|
||||
signLines[1] = plugin.getConfig().getString(prefix+"line2");
|
||||
signLines[2] = plugin.getConfig().getString(prefix+"line3");
|
||||
signLines[3] = plugin.getConfig().getString(prefix+"line4");
|
||||
// Check if the sign should be present
|
||||
Block block = getLocation().getBlock();
|
||||
if(!plugin.getConfig().isSet(prefix)
|
||||
|| ((signLines[0] == null || signLines[0].length() == 0)
|
||||
&& (signLines[1] == null || signLines[1].length() == 0)
|
||||
&& (signLines[2] == null || signLines[2].length() == 0)
|
||||
&& (signLines[3] == null || signLines[3].length() == 0))) {
|
||||
block.setType(Material.AIR);
|
||||
} else {
|
||||
Sign signState = null;
|
||||
if(block.getType() != Material.WALL_SIGN && block.getType() != Material.SIGN_POST) {
|
||||
Material signType;
|
||||
try {
|
||||
signType = Material.valueOf(config.getString("general.signs."+key+".signType"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signType = null;
|
||||
}
|
||||
if(signType != Material.WALL_SIGN && signType != Material.SIGN_POST) {
|
||||
AreaShop.debug(" setting sign failed");
|
||||
return false;
|
||||
}
|
||||
block.setType(signType);
|
||||
signState = (Sign)block.getState();
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
BlockFace signFace;
|
||||
try {
|
||||
signFace = BlockFace.valueOf(config.getString("general.signs."+key+".facing"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signFace = null;
|
||||
}
|
||||
if(signFace != null) {
|
||||
signData.setFacingDirection(signFace);
|
||||
signState.setData(signData);
|
||||
}
|
||||
}
|
||||
if(signState == null) {
|
||||
signState = (Sign)block.getState();
|
||||
}
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
if(!config.isString("general.signs."+key+".signType")) {
|
||||
region.setSetting("general.signs."+key+".signType", signState.getType().toString());
|
||||
}
|
||||
if(!config.isString("general.signs."+key+".facing")) {
|
||||
region.setSetting("general.signs."+key+".facing", signData.getFacing().toString());
|
||||
}
|
||||
// Apply replacements and color and then set it on the sign
|
||||
for(int i = 0; i < signLines.length; i++) {
|
||||
if(signLines[i] == null) {
|
||||
signState.setLine(i, "");
|
||||
continue;
|
||||
}
|
||||
signLines[i] = Message.applyReplacements(signLines[i], region);
|
||||
signLines[i] = Utils.applyColors(signLines[i]);
|
||||
signState.setLine(i, signLines[i]);
|
||||
}
|
||||
signState.update();
|
||||
boolean signEmpty = true;
|
||||
for(int i = 0; i < 4; i++) {
|
||||
signLines[i] = stateConfig.getString("line"+(i+1));
|
||||
signEmpty &= (signLines[i] == null || signLines[i].isEmpty());
|
||||
}
|
||||
if(signEmpty) {
|
||||
block.setType(Material.AIR);
|
||||
return true;
|
||||
}
|
||||
|
||||
Sign signState = null;
|
||||
// Place the sign back (with proper rotation and type) after it has been hidden or (indirectly) destroyed
|
||||
if(block.getType() != Material.WALL_SIGN && block.getType() != Material.SIGN_POST) {
|
||||
Material signType;
|
||||
try {
|
||||
signType = Material.valueOf(regionConfig.getString("general.signs."+key+".signType"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signType = null;
|
||||
}
|
||||
if(signType != Material.WALL_SIGN && signType != Material.SIGN_POST) {
|
||||
AreaShop.debug("Setting sign", key, "of region", region.getName(), "failed, could not set sign block back");
|
||||
return false;
|
||||
}
|
||||
block.setType(signType);
|
||||
signState = (Sign)block.getState();
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
BlockFace signFace;
|
||||
try {
|
||||
signFace = BlockFace.valueOf(regionConfig.getString("general.signs."+key+".facing"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signFace = null;
|
||||
}
|
||||
if(signFace != null) {
|
||||
signData.setFacingDirection(signFace);
|
||||
signState.setData(signData);
|
||||
}
|
||||
}
|
||||
if(signState == null) {
|
||||
signState = (Sign)block.getState();
|
||||
}
|
||||
|
||||
// Save current rotation and type
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
if(!regionConfig.isString("general.signs."+key+".signType")) {
|
||||
region.setSetting("general.signs."+key+".signType", signState.getType().toString());
|
||||
}
|
||||
if(!regionConfig.isString("general.signs."+key+".facing")) {
|
||||
region.setSetting("general.signs."+key+".facing", signData.getFacing().toString());
|
||||
}
|
||||
|
||||
// Apply replacements and color and then set it on the sign
|
||||
for(int i = 0; i < signLines.length; i++) {
|
||||
if(signLines[i] == null) {
|
||||
signState.setLine(i, "");
|
||||
continue;
|
||||
}
|
||||
signLines[i] = Message.fromString(signLines[i]).replacements(region).getSingle();
|
||||
signLines[i] = Utils.applyColors(signLines[i]);
|
||||
signState.setLine(i, signLines[i]);
|
||||
}
|
||||
signState.update();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -296,13 +304,15 @@ public class SignsFeature extends Feature {
|
||||
* @return true if it needs periodic updates, otherwise false
|
||||
*/
|
||||
public boolean needsPeriodicUpdate() {
|
||||
// Get the prefix
|
||||
String prefix = "signProfiles."+getProfile()+"."+region.getState().getValue().toLowerCase()+".line";
|
||||
String line;
|
||||
// Get the lines
|
||||
for(int i = 1; i < 5; i++) {
|
||||
line = plugin.getConfig().getString(prefix+i);
|
||||
if(line != null && line.length() != 0 && line.contains(AreaShop.tagTimeLeft)) {
|
||||
ConfigurationSection signConfig = getProfile();
|
||||
if(signConfig == null || !signConfig.isSet(region.getState().getValue().toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
ConfigurationSection stateConfig = signConfig.getConfigurationSection(region.getState().getValue().toLowerCase());
|
||||
// Check the lines for the timeleft tag
|
||||
for(int i = 1; i <= 4; i++) {
|
||||
String line = stateConfig.getString("line"+i);
|
||||
if(line != null && !line.isEmpty() && line.contains(Message.VARIABLESTART+AreaShop.tagTimeLeft+Message.VARIABLEEND)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -316,27 +326,23 @@ public class SignsFeature extends Feature {
|
||||
* @return true if the commands ran successfully, false if any of them failed
|
||||
*/
|
||||
public boolean runSignCommands(Player clicker, GeneralRegion.ClickType clickType) {
|
||||
// Get the profile set in the config
|
||||
String profile = region.getConfig().getString("general.signs."+key+".profile");
|
||||
if(profile == null || profile.length() == 0) {
|
||||
profile = region.getStringSetting("general.signProfile");
|
||||
ConfigurationSection signConfig = getProfile();
|
||||
if(signConfig == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get paths (state may change after running them)
|
||||
String playerPath = "signProfiles."+profile+"."+region.getState().getValue().toLowerCase()+"."+clickType.getValue()+"Player";
|
||||
String consolePath = "signProfiles."+profile+"."+region.getState().getValue().toLowerCase()+"."+clickType.getValue()+"Console";
|
||||
ConfigurationSection stateConfig = signConfig.getConfigurationSection(region.getState().getValue().toLowerCase());
|
||||
|
||||
// Run player commands if specified
|
||||
List<String> playerCommands = new ArrayList<>();
|
||||
for(String command : plugin.getConfig().getStringList(playerPath)) {
|
||||
playerCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
for(String command : stateConfig.getStringList(clickType.getValue()+"Player")) {
|
||||
playerCommands.add(command.replace(Message.VARIABLESTART+AreaShop.tagClicker+Message.VARIABLEEND, clicker.getName()));
|
||||
}
|
||||
region.runCommands(clicker, playerCommands);
|
||||
|
||||
// Run console commands if specified
|
||||
List<String> consoleCommands = new ArrayList<>();
|
||||
for(String command : plugin.getConfig().getStringList(consolePath)) {
|
||||
consoleCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
for(String command : stateConfig.getStringList(clickType.getValue()+"Console")) {
|
||||
consoleCommands.add(command.replace(Message.VARIABLESTART+AreaShop.tagClicker+Message.VARIABLEEND, clicker.getName()));
|
||||
}
|
||||
region.runCommands(Bukkit.getConsoleSender(), consoleCommands);
|
||||
|
||||
|
@ -28,21 +28,24 @@ public class WorldGuardRegionFlagsFeature extends Feature {
|
||||
* @return true if the flags have been set correctly, otherwise false
|
||||
*/
|
||||
protected boolean updateRegionFlags(GeneralRegion region) {
|
||||
boolean result = true;
|
||||
boolean result;
|
||||
|
||||
// General region flags
|
||||
// Get section defining the region flag profile
|
||||
ConfigurationSection flagProfileSection = region.getConfigurationSectionSetting("general.flagProfile", "flagProfiles");
|
||||
if(flagProfileSection == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Region flags for all states
|
||||
String allPath = "flagProfiles."+region.getStringSetting("general.flagProfile")+".ALL";
|
||||
ConfigurationSection generalFlags = plugin.getConfig().getConfigurationSection(allPath);
|
||||
if(plugin.getConfig().isSet(allPath) && generalFlags != null) { // Explicitely check if it is set, so don't apply if only in the default config
|
||||
result = updateRegionFlags(region, generalFlags);
|
||||
}
|
||||
ConfigurationSection allFlags = flagProfileSection.getConfigurationSection("ALL");
|
||||
result = updateRegionFlags(region, allFlags);
|
||||
|
||||
// Specific region flags
|
||||
// Region flags for the current state
|
||||
String specificPath = "flagProfiles."+region.getStringSetting("general.flagProfile")+"."+region.getState().getValue();
|
||||
if(plugin.getConfig().isSet(specificPath)) { // Do no apply default flags if they are removed from the active config
|
||||
ConfigurationSection specificFlags = plugin.getConfig().getConfigurationSection(specificPath);
|
||||
result = result && specificFlags != null && updateRegionFlags(region, specificFlags);
|
||||
}
|
||||
ConfigurationSection stateFlags = flagProfileSection.getConfigurationSection(region.getState().getValue());
|
||||
result = result && updateRegionFlags(region, stateFlags);
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ public class Message {
|
||||
private List<String> message;
|
||||
private Object[] replacements;
|
||||
private String key = null;
|
||||
private boolean doLanguageReplacements = true;
|
||||
|
||||
/**
|
||||
* Internal use only
|
||||
@ -71,16 +72,6 @@ public class Message {
|
||||
return new Message().setMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply replacements to a string
|
||||
* @param message The string to apply replacements to
|
||||
* @param replacements The replacements to apply
|
||||
* @return The message with the replacements applied
|
||||
*/
|
||||
public static String applyReplacements(String message, Object... replacements) {
|
||||
return Message.fromString(message).replacements(replacements).doReplacements().getSingleRaw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message with all replacements done
|
||||
* @return Message as a list
|
||||
@ -103,6 +94,15 @@ public class Message {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message with all replacements done
|
||||
* @return Message as a string
|
||||
*/
|
||||
public String getSingle() {
|
||||
doReplacements();
|
||||
return StringUtils.join(message, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the raw message without replacing anything
|
||||
* @return The message
|
||||
@ -186,6 +186,15 @@ public class Message {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off language replacements for this message
|
||||
* @return this
|
||||
*/
|
||||
public Message noLanguageReplacements() {
|
||||
doLanguageReplacements = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the message to a target
|
||||
* @param target The target to send the message to (Player, CommandSender, Logger)
|
||||
@ -299,7 +308,9 @@ public class Message {
|
||||
break;
|
||||
}
|
||||
replaceArgumentVariables(limit);
|
||||
replaceLanguageVariables(limit);
|
||||
if(doLanguageReplacements) {
|
||||
replaceLanguageVariables(limit);
|
||||
}
|
||||
|
||||
shouldReplace = !message.equals(original);
|
||||
}
|
||||
|
@ -18,8 +18,10 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.command.CommandException;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
@ -274,14 +276,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
public boolean isRestoreEnabled() {
|
||||
return getBooleanSetting("general.enableRestore");
|
||||
}
|
||||
/**
|
||||
* Get the restoreprofile as defined in config.yml
|
||||
* @return The restoreprofile
|
||||
*/
|
||||
public String getRestoreProfile() {
|
||||
return getStringSetting("general.schematicProfile");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the time that the player was last active
|
||||
* @return Current time if he is online, last online time if offline, -1 if the region has no owner
|
||||
@ -694,7 +689,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
File parent = saveFile.getParentFile();
|
||||
if (parent != null && !parent.exists()) {
|
||||
if (!parent.mkdirs()) {
|
||||
AreaShop.warn("Did not save region "+getName()+", schematic directory could not be created: "+saveFile);
|
||||
AreaShop.warn("Did not save region "+getName()+", schematic directory could not be created: "+saveFile.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -718,12 +713,20 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
// The path to save the schematic
|
||||
File restoreFile = new File(plugin.getFileManager().getSchematicFolder() + File.separator + fileName + AreaShop.schematicExtension);
|
||||
if(!restoreFile.exists() || !restoreFile.isFile()) {
|
||||
AreaShop.info("Did not restore region "+getName()+", schematic file does not exist: "+restoreFile);
|
||||
AreaShop.info("Did not restore region "+getName()+", schematic file does not exist: "+restoreFile.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
boolean result = plugin.getWorldEditHandler().restoreRegionBlocks(restoreFile, this);
|
||||
if(result) {
|
||||
AreaShop.debug("Restored schematic for region " + getName());
|
||||
|
||||
// Workaround for signs inside the region in combination with async restore of plugins like AsyncWorldEdit and FastAsyncWorldEdit
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getSignsFeature().update();
|
||||
}
|
||||
}.runTaskLater(plugin, 10L);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -1381,6 +1384,89 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
return this.getFileManager().getDefaultSettings().getStringList(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a configuration section setting for this region, defined as follows
|
||||
* - If the region has the setting in its own file (/regions/regionName.yml), use that
|
||||
* - If the region has groups, use the setting defined by the most important group, if any
|
||||
* - Otherwise fallback to the default.yml file setting
|
||||
* @param path The path to get the setting of
|
||||
* @return The value of the setting
|
||||
*/
|
||||
public ConfigurationSection getConfigurationSectionSetting(String path) {
|
||||
if(config.isSet(path)) {
|
||||
return config.getConfigurationSection(path);
|
||||
}
|
||||
ConfigurationSection result = null;
|
||||
int priority = Integer.MIN_VALUE;
|
||||
boolean found = false;
|
||||
for(RegionGroup group : plugin.getFileManager().getGroups()) {
|
||||
if(group.isMember(this) && group.getSettings().isSet(path) && group.getPriority() > priority) {
|
||||
result = group.getSettings().getConfigurationSection(path);
|
||||
priority = group.getPriority();
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if(found) {
|
||||
return result;
|
||||
}
|
||||
return this.getFileManager().getDefaultSettings().getConfigurationSection(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a configuration section setting for this region, defined as follows
|
||||
* - If the region has the setting in its own file (/regions/regionName.yml), use that
|
||||
* - If the region has groups, use the setting defined by the most important group, if any
|
||||
* - Otherwise fallback to the default.yml file setting
|
||||
* @param path The path to get the setting of
|
||||
* @param translateProfileName The name of the profile section in the plugin config file to translate result strings into sections
|
||||
* @return The value of the setting
|
||||
*/
|
||||
public ConfigurationSection getConfigurationSectionSetting(String path, String translateProfileName) {
|
||||
return getConfigurationSectionSetting(path, translateProfileName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a configuration section setting for this region, defined as follows
|
||||
* - If earlyResult is non-null, use that
|
||||
* - Else if the region has the setting in its own file (/regions/regionName.yml), use that
|
||||
* - Else if the region has groups, use the setting defined by the most important group, if any
|
||||
* - Otherwise fallback to the default.yml file setting
|
||||
* @param path The path to get the setting of
|
||||
* @param translateProfileName The name of the profile section in the plugin config file to translate result strings into sections
|
||||
* @param earlyResult Result that should have priority over the rest
|
||||
* @return The value of the setting
|
||||
*/
|
||||
public ConfigurationSection getConfigurationSectionSetting(String path, String translateProfileName, Object earlyResult) {
|
||||
Object result = null;
|
||||
if(earlyResult != null) {
|
||||
result = earlyResult;
|
||||
} else if(config.isSet(path)) {
|
||||
result = config.get(path);
|
||||
} else {
|
||||
boolean found = false;
|
||||
int priority = Integer.MIN_VALUE;
|
||||
for(RegionGroup group : plugin.getFileManager().getGroups()) {
|
||||
if(group.isMember(this) && group.getSettings().isSet(path) && group.getPriority() > priority) {
|
||||
result = group.getSettings().get(path);
|
||||
priority = group.getPriority();
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if(!found) {
|
||||
result = this.getFileManager().getDefaultSettings().get(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Either result is a ConfigurationSection or is used as key in the plugin config to get a ConfigurationSection
|
||||
if(result == null) {
|
||||
return null;
|
||||
} else if(result instanceof ConfigurationSection) {
|
||||
return (ConfigurationSection)result;
|
||||
} else {
|
||||
return plugin.getConfig().getConfigurationSection(translateProfileName+"."+result.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a setting in the file of the region itself
|
||||
* @param path The path to set
|
||||
@ -1623,9 +1709,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks an event and handles saving to and restoring from schematic for it
|
||||
* @param type The type of event
|
||||
@ -1633,25 +1717,27 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
public void handleSchematicEvent(RegionEvent type) {
|
||||
// Check the individual>group>default setting
|
||||
if(!isRestoreEnabled()) {
|
||||
AreaShop.debug("Schematic operations for " + getName() + " not enabled, skipped");
|
||||
AreaShop.debug("Schematic operations for "+getName()+" not enabled, skipped");
|
||||
return;
|
||||
}
|
||||
// Get the safe and restore names
|
||||
String save = plugin.getConfig().getString("schematicProfiles." + getRestoreProfile() + "." + type.getValue() + ".save");
|
||||
String restore = plugin.getConfig().getString("schematicProfiles." + getRestoreProfile() + "." + type.getValue() + ".restore");
|
||||
// Get the safe and restore names
|
||||
ConfigurationSection profileSection = getConfigurationSectionSetting("general.schematicProfile", "schematicProfiles");
|
||||
String save = profileSection.getString(type.getValue()+".save");
|
||||
String restore = profileSection.getString(type.getValue()+".restore");
|
||||
// Save the region if needed
|
||||
if(save != null && save.length() != 0) {
|
||||
save = Message.applyReplacements(save, this);
|
||||
this.saveRegionBlocks(save);
|
||||
save = Message.fromString(save).replacements(this).getSingle();
|
||||
saveRegionBlocks(save);
|
||||
}
|
||||
// Restore the region if needed
|
||||
if(restore != null && restore.length() != 0) {
|
||||
restore = Message.applyReplacements(restore, this);
|
||||
this.restoreRegionBlocks(restore);
|
||||
restore = Message.fromString(restore).replacements(this).getSingle();
|
||||
restoreRegionBlocks(restore);
|
||||
}
|
||||
}
|
||||
|
||||
// COMMAND EXECUTING
|
||||
// COMMAND EXECUTING
|
||||
|
||||
/**
|
||||
* Run commands as the CommandsSender, replacing all tags with the relevant values
|
||||
* @param sender The sender that should perform the command
|
||||
@ -1666,7 +1752,9 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
if(command == null || command.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
command = Message.applyReplacements(command, this);
|
||||
// It is not ideal we have to disable language replacements here, but otherwise giving language variables
|
||||
// to '/areashop message' by a command in the config gets replaced and messes up the fancy formatting.
|
||||
command = Message.fromString(command).replacements(this).noLanguageReplacements().getSingle();
|
||||
|
||||
boolean result;
|
||||
String error = null;
|
||||
@ -1707,21 +1795,14 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
||||
* @param before The 'before' or 'after' commands
|
||||
*/
|
||||
public void runEventCommands(RegionEvent event, boolean before) {
|
||||
String profile = getStringSetting("general.eventCommandProfile");
|
||||
if(profile == null || profile.length() == 0) {
|
||||
ConfigurationSection eventCommandProfileSection = getConfigurationSectionSetting("general.eventCommandProfile", "eventCommandProfiles");
|
||||
if(eventCommandProfileSection == null) {
|
||||
return;
|
||||
}
|
||||
String path = "eventCommandProfiles." + profile + "." + event.getValue().toLowerCase();
|
||||
if(before) {
|
||||
path += ".before";
|
||||
} else {
|
||||
path += ".after";
|
||||
}
|
||||
List<String> commands = plugin.getConfig().getStringList(path);
|
||||
// Don't waste time if there are no commands to be run
|
||||
List<String> commands = eventCommandProfileSection.getStringList(event.getValue()+"."+(before ? "before" : "after"));
|
||||
if(commands == null || commands.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
runCommands(Bukkit.getConsoleSender(), commands);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.entity.Player;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static me.wiefferink.areashop.Utils.millisToHumanFormat;
|
||||
@ -320,7 +321,7 @@ public class RentRegion extends GeneralRegion {
|
||||
double percentage = (getMoneyBackPercentage()) / 100.0;
|
||||
Double timePeriod = (double) (getDuration());
|
||||
double periods = timeLeft / timePeriod;
|
||||
return periods * getPrice() * percentage;
|
||||
return Math.max(0, periods*getPrice()*percentage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -348,7 +349,7 @@ public class RentRegion extends GeneralRegion {
|
||||
if(!isDeleted() && isRented() && now > getRentedUntil()) {
|
||||
// Send message to the player if online
|
||||
Player player = Bukkit.getPlayer(getRenter());
|
||||
if(unRent(false, player)) {
|
||||
if(unRent(false, null)) {
|
||||
if(player != null) {
|
||||
message(player, "unrent-expired");
|
||||
}
|
||||
@ -363,19 +364,19 @@ public class RentRegion extends GeneralRegion {
|
||||
* Sends all warnings since previous call until (now + normal delay), delay can be found in the config as well
|
||||
*/
|
||||
public void sendExpirationWarnings() {
|
||||
// send from warningsDoneUntil to current+delay
|
||||
// Send from warningsDoneUntil to current+delay
|
||||
if(isDeleted() || !isRented()) {
|
||||
return;
|
||||
}
|
||||
Player player = Bukkit.getPlayer(getRenter());
|
||||
long sendUntil = Calendar.getInstance().getTimeInMillis()+(plugin.getConfig().getInt("expireWarning.delay")*60*1000);
|
||||
// loop through warning defined in the config for the profile that is set for this region
|
||||
String configPath = "expirationWarningProfiles."+getStringSetting("rent.expirationWarningProfile");
|
||||
ConfigurationSection section = plugin.getConfig().getConfigurationSection(configPath);
|
||||
if(section == null) {
|
||||
ConfigurationSection profileSection = getConfigurationSectionSetting("rent.expirationWarningProfile", "expirationWarningProfiles");
|
||||
if(profileSection == null) {
|
||||
return;
|
||||
}
|
||||
for(String timeBefore : section.getKeys(false)) {
|
||||
|
||||
// Check if a warning needs to be send for each defined point in time
|
||||
Player player = Bukkit.getPlayer(getRenter());
|
||||
long sendUntil = Calendar.getInstance().getTimeInMillis()+(plugin.getConfig().getInt("expireWarning.delay")*60*1000);
|
||||
for(String timeBefore : profileSection.getKeys(false)) {
|
||||
long timeBeforeParsed = Utils.durationStringToLong(timeBefore);
|
||||
if(timeBeforeParsed <= 0) {
|
||||
return;
|
||||
@ -383,10 +384,22 @@ public class RentRegion extends GeneralRegion {
|
||||
long checkTime = getRentedUntil()-timeBeforeParsed;
|
||||
|
||||
if(checkTime > warningsDoneUntil && checkTime <= sendUntil) {
|
||||
if(plugin.getConfig().getBoolean(configPath+"."+timeBefore+".warnPlayer") && player != null) {
|
||||
message(player, "rent-expireWarning");
|
||||
List<String> commands;
|
||||
if(profileSection.isConfigurationSection(timeBefore)) {
|
||||
/* Legacy config layout:
|
||||
* "1 minute":
|
||||
* warnPlayer: true
|
||||
* commands: ["say hi"]
|
||||
*/
|
||||
commands = profileSection.getStringList(timeBefore+".commands");
|
||||
// Warn player
|
||||
if(profileSection.getBoolean(timeBefore+".warnPlayer") && player != null) {
|
||||
message(player, "rent-expireWarning", this);
|
||||
}
|
||||
} else {
|
||||
commands = profileSection.getStringList(timeBefore);
|
||||
}
|
||||
this.runCommands(Bukkit.getConsoleSender(), plugin.getConfig().getStringList(configPath+"."+timeBefore+".commands"));
|
||||
this.runCommands(Bukkit.getConsoleSender(), commands);
|
||||
}
|
||||
}
|
||||
warningsDoneUntil = sendUntil;
|
||||
|
@ -6,53 +6,54 @@
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options that influence the global state of the plugin │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Chatprefix used for all messages in the chat, also changes the greeting messages.
|
||||
# Chat prefix used for all messages in the chat, also changes the greeting messages.
|
||||
chatPrefix:
|
||||
- '[darkgreen][AreaShop][reset]'
|
||||
- ' hover: AreaShop region management plugin'
|
||||
- ' hover: %lang:action|Click to check the available commands|%'
|
||||
- ' command: /areashop help'
|
||||
- ' '
|
||||
## The language file that should be used, check the 'lang' folder for build-in languages (use the filename without .yml here).
|
||||
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Language-support.
|
||||
# The language file that should be used, check the 'lang' folder for build-in languages (use the filename without .yml here).
|
||||
# More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Language-support.
|
||||
language: EN
|
||||
## The tags that need to be written on the first line of a sign to use it with AreaShop.
|
||||
# The tags that need to be written on the first line of a sign to add it to AreaShop.
|
||||
signTags:
|
||||
## Add a rental region.
|
||||
# Add a rental region.
|
||||
rent: '[asrent]'
|
||||
## Add a buy region.
|
||||
# Add a buy region.
|
||||
buy: '[asbuy]'
|
||||
## Add a sign to an existing region.
|
||||
# Add a sign to an existing region.
|
||||
add: '[as]'
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ NUMBERS: Options to change the display of prices. │
|
||||
# │ ECONOMY: Options to change the display of prices. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## The characters displayed before a price.
|
||||
# The characters displayed before a price.
|
||||
moneyCharacter: '$'
|
||||
## The characters displayed after a price.
|
||||
# The characters displayed after a price.
|
||||
moneyCharacterAfter: ''
|
||||
## How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01', '5.20').
|
||||
# How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01', '5.20').
|
||||
fractionalNumbers: 2
|
||||
## Set this to true if you want to hide '.0' for a number like '15.0' ('4.50' will still stay '4.50').
|
||||
# Set this to true if you want to hide '.0' for a number like '15.0' ('4.50' will still stay '4.50').
|
||||
hideEmptyFractionalPart: true
|
||||
## Use metric suffixes if the price is above this number (use 1.00M instead of 1000000.00 etc.), use -1 to disable.
|
||||
## Indications are used as defined on: http://en.wikipedia.org/wiki/Metric_prefix, implemented from 'k' to 'Y'.
|
||||
# Use metric suffixes if the price is above this number (use 1.00M instead of 1000000.00 etc.), use -1 to disable.
|
||||
# Indications are used as defined on: http://en.wikipedia.org/wiki/Metric_prefix, implemented from 'k' to 'Y'.
|
||||
metricSuffixesAbove: 1000000.0
|
||||
## The character(s) to use as decimal mark.
|
||||
# The character(s) to use as decimal mark.
|
||||
decimalMark: '.'
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ RENTING: Options that apply to all rent regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Timeformat to use on the signs, default is like '30-06 14:52', US format: 'MM-dd KK:mm a'.
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
# Timeformat to use on the signs, default is like '30-06 14:52', US format: 'MM-dd KK:mm a'.
|
||||
# Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
timeFormatSign: 'dd-MM HH:mm'
|
||||
## Timeformat used in the chat, default is like '30 june 2014 14:52', US format: 'MMMMMMMMMMMMMMMMM dd yyyy KK:mm a'.
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
# Timeformat used in the chat, default is like '30 june 2014 14:52', US format: 'MMMMMMMMMMMMMMMMM dd yyyy KK:mm a'.
|
||||
# Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
timeFormatChat: 'dd MMMMMMMMMMMMMMMMM yyyy HH:mm'
|
||||
## Time indicators, used for specifing time periods (for example rent duration).
|
||||
# Time indicators, used for specifing time periods (for example rent duration).
|
||||
seconds: [s, sec, secs, second, seconds]
|
||||
minutes: [m, min, mins, minute, minutes]
|
||||
hours: [h, hour, hours]
|
||||
@ -65,12 +66,12 @@ years: [y, year, years]
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ PERMISSION GROUPS: Assigned by giving players certain permissions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Configure the max total regions, max rent regions and max buy regions with different groups (-1 is unlimited).
|
||||
## Assign a group to players by giving them the permission 'areashop.limits.<group>'.
|
||||
## Every player already has the group 'default', OPs bypass the limits because of the 'areashop.limitbypass' permission.
|
||||
## All the groups applied to the player will be checked and only if they all allow an extra region it will be allowed.
|
||||
## More information like limits for regions of a certain group or in a certain word can be found here:
|
||||
## https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples.
|
||||
# Configure the max total regions, max rent regions and max buy regions with different groups (-1 is unlimited).
|
||||
# Assign a group to players by giving them the permission 'areashop.limits.<group>'.
|
||||
# Every player already has the group 'default', OPs bypass the limits because of the 'areashop.limitbypass' permission.
|
||||
# All the groups applied to the player will be checked and only if they all allow an extra region it will be allowed.
|
||||
# More information like limits for regions of a certain group or in a certain word can be found here:
|
||||
# https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples.
|
||||
limitGroups:
|
||||
default:
|
||||
total: 1
|
||||
@ -78,274 +79,92 @@ limitGroups:
|
||||
buys: 1
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ PROFILES: Assigned in general (default.yml), for a group (groups.yml) or individually (<region>.yml) │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## The idea of profiles is that you can make different variations of them, and then assign the different variations to
|
||||
## subsets of regions (by assigning a profile to a region group, or an individual region).
|
||||
|
||||
## Determines the layout and functions of the signs linked to regions.
|
||||
## Set 'general.signProfile' in default.yml, groups or individual regions to set the profile.
|
||||
## The following sections can be added for performing certain commands when the sign is clicked:
|
||||
## rightClickPlayer, rightClickConsole, shiftRightClickPlayer, shiftRightClickConsole,
|
||||
## leftClickPlayer, leftClickConsole, shiftLeftClickPlayer, shiftLeftClickConsole.
|
||||
## Sections with 'Player' at the end will be run by the player that clicks the sign and 'Console' ones from the console.
|
||||
signProfiles:
|
||||
default:
|
||||
forrent:
|
||||
line1: '&2&l[For Rent]'
|
||||
line2: '%region%'
|
||||
line3: '%duration%'
|
||||
line4: '%price%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
rightClickConsole:
|
||||
#- 'areashop message %clicker% %lang:confirm-rent|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
rented:
|
||||
line1: '&4&l[Rented]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4: '%untilshort%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
rightClickConsole:
|
||||
#- 'areashop message %clicker% %lang:confirm-extend|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickConsole:
|
||||
- 'areashop message %clicker% %lang:confirm-unrent|%region%|%'
|
||||
forsale:
|
||||
line1: '&2&l[For Sale]'
|
||||
line2: '%region%'
|
||||
line3: '%price%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
rightClickConsole:
|
||||
#- 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
resell:
|
||||
line1: '&9&l[Resale]'
|
||||
line2: '%region%'
|
||||
line3: '%resellprice%'
|
||||
line4: '&8%player%'
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
rightClickConsole:
|
||||
#- 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop stopresell %region%'
|
||||
sold:
|
||||
line1: '&4&l[Sold]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickConsole:
|
||||
- 'areashop message %clicker% %lang:confirm-sell|%region%|%'
|
||||
|
||||
## Flag profiles specify which flags to set on the WorldGuard regions depending on their state.
|
||||
## All normal region flags as present in WorldGuard can be used, and also members, owners, priority and parent.
|
||||
## The members and owners flag normally take a list of UUID's separated by a comma, adding by name is possible with 'n:<name>'.
|
||||
## You can add groups by using 'g:<groupname>', so an example woul be: '%uuid%, %friendsuuid%, g:vip, n:coolGuy'.
|
||||
## For allow/deny flags like 'entry' and 'exit' you can set the group setting by using 'g:<scope>', <scope> is one of the following:
|
||||
## members, non_members, owners, non_owners, all. Example, only members can enter the region:
|
||||
## entry: 'deny g:non_members'
|
||||
## '' will remove the flag from the region.
|
||||
flagProfiles:
|
||||
default:
|
||||
ALL: # Flags to apply for all states
|
||||
priority: 10
|
||||
members: ''
|
||||
interact: 'deny g:non_members' # Only allow region members/owners to use things in the region (chests, furnace, animals, etc.)
|
||||
build: 'deny g:non_members'
|
||||
forrent:
|
||||
greeting: '%lang:prefix%%lang:greeting-forrent%'
|
||||
rented:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-rented%'
|
||||
forsale:
|
||||
greeting: '%lang:prefix%%lang:greeting-forsale%'
|
||||
sold:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-bought%'
|
||||
resale:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-resale%'
|
||||
|
||||
## Run commands when an event happens.
|
||||
## Commands at a 'before' section will execute before the region details are changed in the AreaShop system
|
||||
## and before any other actions occurred (setting the owner, saving/loading schematics, etc.),
|
||||
## the 'after' commands will be run when all changes are done.
|
||||
## You can add a list of commands to 'before' and 'after'.
|
||||
eventCommandProfiles:
|
||||
default:
|
||||
created:
|
||||
before:
|
||||
after:
|
||||
## - "say An AreaShop region has been created: %region%"
|
||||
deleted:
|
||||
before:
|
||||
after:
|
||||
rented:
|
||||
before:
|
||||
after:
|
||||
extended:
|
||||
before:
|
||||
after:
|
||||
unrented:
|
||||
before:
|
||||
after:
|
||||
bought:
|
||||
before:
|
||||
after:
|
||||
sold:
|
||||
before:
|
||||
after:
|
||||
resell:
|
||||
before:
|
||||
after:
|
||||
|
||||
## For the following events you can specify if you want to restore or save the region to a schematic.
|
||||
## After 'save:' or 'restore:' you enter the name of the file to restore from/to.
|
||||
## The limit 'maximumBlocks' applies to restoring/saving schematics, be sure your region size is below the limit.
|
||||
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Region-blocks-save-restore.
|
||||
schematicProfiles:
|
||||
default:
|
||||
created:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
deleted:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
rented:
|
||||
save: ''
|
||||
restore: ''
|
||||
unrented:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
bought:
|
||||
save: ''
|
||||
restore: ''
|
||||
sold:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
resell:
|
||||
save: ''
|
||||
restore: ''
|
||||
|
||||
## Profiles that specify what happens when their rental region almost runs out.
|
||||
## Time identifiers specify how much time before the rent is actually over the player should be notified.
|
||||
## When warnPlayer is set to true a message will be send that is specified in the language file.
|
||||
## All commands in the list below 'commands:' will execute together with the warning, all normal variables can be used.
|
||||
expirationWarningProfiles:
|
||||
default:
|
||||
"1 day":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
## - "say %region% is about to expire for %player%: %timeleft% left"
|
||||
"1 hour":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
"5 minutes":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ ADVANCED AND DEBUG: Specific options to tweak the plugin precisely and check if it functions correctly. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Blacklist of region names that cannot be added to AreaShop for renting or buying. Regular expressions can be used, search
|
||||
## for 'java regex pattern' to find documentation about how to use it.
|
||||
## Example: Blocking all regions that have a name like 'house_1', 'house_2', etc. would be done with 'house_\d+'.
|
||||
## The '\d' represents the numerical digits 0-9, the + symbol represents 1 or more times repeated.
|
||||
## This means it would also block 'house_123' and 'house_000456'. It will not block 'ahouse_1' or 'house_'.
|
||||
# Blacklist of region names that cannot be added to AreaShop for renting or buying. Regular expressions can be used, search
|
||||
# for 'java regex pattern' to find documentation about how to use it.
|
||||
# Example: Blocking all regions that have a name like 'house_1', 'house_2', etc. would be done with 'house_\d+'.
|
||||
# The '\d' represents the numerical digits 0-9, the + symbol represents 1 or more times repeated.
|
||||
# This means it would also block 'house_123' and 'house_000456'. It will not block 'ahouse_1' or 'house_'.
|
||||
blacklist:
|
||||
- '__global__'
|
||||
## Minimum length of the numbers that are suffixed for region names generated by the '/as stack' command.
|
||||
## When having this at 3 it will generate names like this: 'region-001', 'region-014', 'region-4567'.
|
||||
# Minimum length of the numbers that are suffixed for region names generated by the '/as stack' command.
|
||||
# When having this at 3 it will generate names like this: 'region-001', 'region-014', 'region-4567'.
|
||||
stackRegionNumberLength: 3
|
||||
# Allow/disallow adding players that did not visit the server yet as friend of a region.
|
||||
addFriendNotExistingPlayers: false
|
||||
## Enable sending stats to http://mcstats.org/ (Metrics plugin).
|
||||
## This information will give me an indication about how much the plugin is used and encourages me to continue development.
|
||||
# Enable sending stats to http://mcstats.org/ (Metrics plugin).
|
||||
# This information will give me an indication about how much the plugin is used and encourages me to continue development.
|
||||
sendStats: true
|
||||
## If enabled it will check for updates when loading the plugin, it will never download files, it will only notify about it
|
||||
## A message will be printed in the console when an update is available and OPs will be notified when joining the server.
|
||||
# If enabled it will check for updates when loading the plugin, it will never download files, it will only notify about it.
|
||||
checkForUpdates: true
|
||||
## Use colors when sending messages to console and log files.
|
||||
# Use colors when sending messages to console and log files.
|
||||
useColorsInConsole: false
|
||||
## Use tellraw style messages
|
||||
# Use tellraw style messages, which can be interacted with by players
|
||||
useFancyMessages: true
|
||||
## Update all region flags and signs after starting the plugin (uses the 'regionsPerTick' setting from the 'update' section).
|
||||
## This ensures that changes to the config are directly visible after restarting the server.
|
||||
# Update all region flags and signs after starting the plugin.
|
||||
# This ensures that changes to the config are directly visible after restarting the server.
|
||||
updateRegionsOnStartup: true
|
||||
## Enables / disables debug messages in the console, could be useful to figure out where errors come from.
|
||||
# Enables / disables debug messages in the console, could be useful to figure out where errors come from.
|
||||
debug: false
|
||||
## Version of the config, do not change!
|
||||
# Version of the config, do not change!
|
||||
version: ${project.version}
|
||||
## Maximum number of blocks to save to or restore from a .schemetic file.
|
||||
# Maximum number of blocks to save to or restore from a .schemetic file.
|
||||
maximumBlocks: 1000000
|
||||
## Maximum number of locations the teleport function should check to find a safe spot.
|
||||
# Maximum number of locations the teleport function should check to find a safe spot.
|
||||
maximumTries: 50000
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ VARIABLES: Variables that can be used in messages and settings where a region is available. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## If a tag has no value (for example %player% when the region is not rented/bought) then the tag will not get replaced.
|
||||
## %region% The region name (with correct capitalization).
|
||||
## %player% The name of the player that rents/buys the region (with correct capitalization).
|
||||
## %uuid% The UUID of the player that rents/buys the region.
|
||||
## %friends% The names of friends added to this region separated by ', '.
|
||||
## %friendsuuid% The UUID's of friends added to this region separated by ', '.
|
||||
## $landlord$ The name of the landlord.
|
||||
## %landlorduuid% The UUID of the landlord.
|
||||
## %price% The price of the region formatted with the configured characters before and after the number.
|
||||
## %rawprice% The price without formatting, like '10.0' or '7.77'.
|
||||
## %duration% The duration of a rent region, for example '1 d', '4 minutes' or '2 years'.
|
||||
## %world% The name of the world that the region is in.
|
||||
## %type% The type of the region, 'rent' or 'buy'.
|
||||
## %until% The end time of a rent formatted as configured with 'timeFormatChat'.
|
||||
## %untilshort% The end time of a rent formatted as configured with 'timeFormatSign'.
|
||||
## %width% The width of the region (number of blocks on the x-axis).
|
||||
## %depth% The depth of the region (number of blocks on the z-axis).
|
||||
## %height% The height of the region (number 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).
|
||||
## %clicker% The name of the player that clicked the sign (only to be used in the signProfiles section).
|
||||
## %resellprice% The price of a region when it is in resell mode.
|
||||
## %rawresellprice% The resellprice without formatting.
|
||||
## %moneyback% The amount of money the player will get back when unrenting/selling the region (formatted with currency layout).
|
||||
## %rawmoneyback% The moneyback without formatting.
|
||||
## %moneybackpercent% The percentage of the price the player will get back when unrenting the region.
|
||||
## %maxextends% The maximum number of extends a player can do on the region.
|
||||
## %extendsleft% The number of extends that are left (maxextends - timesextended).
|
||||
## %maxrenttime% The maximum time you can rent a region in advance (human readable).
|
||||
## %inactivetime% The maximum time a player may be inactive before unrent/sell (human readable).
|
||||
## %year% The current year.
|
||||
## %month% The current month in the year.
|
||||
## %day% The current day in the month.
|
||||
## %hour% The current hour in the day (0-23).
|
||||
## %minute% The current minute of the hour.
|
||||
## %second% The current second of the minute.
|
||||
## %millisecond% The current millisecond of the second.
|
||||
## %epoch% The number of milliseconds since January 1, 1970 (Unix Epoch).
|
||||
## %tpx% The exact x coordinate of the location that the teleport is set to
|
||||
## %tpy% The exact y coordinate of the location that the teleport is set to
|
||||
## %tpz% The exact z coordinate of the location that the teleport is set to
|
||||
## %tpblockx% The rounded x coordinate of the location that the teleport is set to
|
||||
## %tpblocky% The rounded y coordinate of the location that the teleport is set to
|
||||
## %tpblockz% The rounded z coordinate of the location that the teleport is set to
|
||||
## %tppitch% The exact pitch of the teleport location
|
||||
## %tppitchround% The rounded pitch of the teleport location
|
||||
## %tpyaw% The exact yaw of the teleport location
|
||||
## %tpyawround% The rounded yaw of the teleport location
|
||||
## %tpworld% The world name of the teleport location
|
||||
# If a tag has no value (for example %player% when the region is not rented/bought) then the tag will not get replaced.
|
||||
# %region% The region name (with correct capitalization).
|
||||
# %player% The name of the player that rents/buys the region (with correct capitalization).
|
||||
# %uuid% The UUID of the player that rents/buys the region.
|
||||
# %friends% The names of friends added to this region separated by ', '.
|
||||
# %friendsuuid% The UUID's of friends added to this region separated by ', '.
|
||||
# $landlord$ The name of the landlord.
|
||||
# %landlorduuid% The UUID of the landlord.
|
||||
# %price% The price of the region formatted with the configured characters before and after the number.
|
||||
# %rawprice% The price without formatting, like '10.0' or '7.77'.
|
||||
# %duration% The duration of a rent region, for example '1 d', '4 minutes' or '2 years'.
|
||||
# %world% The name of the world that the region is in.
|
||||
# %type% The type of the region, 'rent' or 'buy'.
|
||||
# %until% The end time of a rent formatted as configured with 'timeFormatChat'.
|
||||
# %untilshort% The end time of a rent formatted as configured with 'timeFormatSign'.
|
||||
# %width% The width of the region (number of blocks on the x-axis).
|
||||
# %depth% The depth of the region (number of blocks on the z-axis).
|
||||
# %height% The height of the region (number 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).
|
||||
# %clicker% The name of the player that clicked the sign (only to be used in the signProfiles section).
|
||||
# %resellprice% The price of a region when it is in resell mode.
|
||||
# %rawresellprice% The resellprice without formatting.
|
||||
# %moneyback% The amount of money the player will get back when unrenting/selling the region (formatted with currency layout).
|
||||
# %rawmoneyback% The moneyback without formatting.
|
||||
# %moneybackpercent% The percentage of the price the player will get back when unrenting the region.
|
||||
# %maxextends% The maximum number of extends a player can do on the region.
|
||||
# %extendsleft% The number of extends that are left (maxextends - timesextended).
|
||||
# %maxrenttime% The maximum time you can rent a region in advance (human readable).
|
||||
# %inactivetime% The maximum time a player may be inactive before unrent/sell (human readable).
|
||||
# %year% The current year.
|
||||
# %month% The current month in the year.
|
||||
# %day% The current day in the month.
|
||||
# %hour% The current hour in the day (0-23).
|
||||
# %minute% The current minute of the hour.
|
||||
# %second% The current second of the minute.
|
||||
# %millisecond% The current millisecond of the second.
|
||||
# %epoch% The number of milliseconds since January 1, 1970 (Unix Epoch).
|
||||
# %tpx% The exact x coordinate of the location that the teleport is set to
|
||||
# %tpy% The exact y coordinate of the location that the teleport is set to
|
||||
# %tpz% The exact z coordinate of the location that the teleport is set to
|
||||
# %tpblockx% The rounded x coordinate of the location that the teleport is set to
|
||||
# %tpblocky% The rounded y coordinate of the location that the teleport is set to
|
||||
# %tpblockz% The rounded z coordinate of the location that the teleport is set to
|
||||
# %tppitch% The exact pitch of the teleport location
|
||||
# %tppitchround% The rounded pitch of the teleport location
|
||||
# %tpyaw% The exact yaw of the teleport location
|
||||
# %tpyawround% The rounded yaw of the teleport location
|
||||
# %tpworld% The world name of the teleport location
|
||||
# %lang:<languageKey>|Optional arguments|% Insert a message from EN.yml, for example: '%lang:timeleft-ended%' or '%lang:timeleft-years|15|%'
|
@ -4,75 +4,227 @@
|
||||
# ║ More information and tutorials can be found on the wiki: https://github.com/NLthijs48/AreaShop/wiki ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options for all regions. │
|
||||
# │ GENERAL: Settings that apply to all regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
general:
|
||||
## Set to true to enable saving/restoring for regions as specified in the profile below, which is specified in the config.
|
||||
enableRestore: false
|
||||
## The schematic profile from the 'schematicProfiles' section in the config.
|
||||
schematicProfile: 'default'
|
||||
## The event commands profile from the 'eventCommandProfiles' section in the config.
|
||||
eventCommandProfile: 'default'
|
||||
## The profile for the format of the sign from the 'signProfiles' section in the config.
|
||||
signProfile: 'default'
|
||||
## The profile for the WorldGuard flags from the 'flagProfiles' section in the config.
|
||||
flagProfile: 'default'
|
||||
## The y location within the region to start searching for safe teleport spots (x and z will be in the middle of the region).
|
||||
## Possible values: bottom, middle, top, integer.
|
||||
# The y location within the region to start searching for safe teleport locations (x and z are in the middle of the region).
|
||||
# Possible values: 'bottom', 'middle', 'top' or a number indicating an exact y coordinate.
|
||||
teleportLocationY: bottom
|
||||
## If true the teleportation algorithm only allows telportation to inside the region, otherwise it will expand
|
||||
## a cube from the starting point to check for safe spots (then it could end outside of the region).
|
||||
# If true the teleportation algorithm only allows telportation to inside the region, otherwise it will expand
|
||||
# a cube from the starting point to check for safe spots (then it could end outside of the region).
|
||||
teleportIntoRegion: true
|
||||
## Same as above, but then for when you teleport to the sign of a region instead of the region itself.
|
||||
# Same as above, but then for when you teleport to the sign of a region instead of the region itself.
|
||||
teleportToSignIntoRegion: false
|
||||
## Set where the '/as find' command should teleport the player to, set to true for the first sign of the region and set to
|
||||
## false to teleport to the location set by '/as settp' or the default location (if not set).
|
||||
# Set where the '/as find' command should teleport the player to, set to true for the first sign of the region and set to
|
||||
# false to teleport to the location set by '/as settp' or the default location (if not set).
|
||||
findTeleportToSign: true
|
||||
## Restricts the '/as buy' and '/as rent' commands to the world of the region.
|
||||
# Restricts buying and renting of regions to the world of the region.
|
||||
restrictedToWorld: false
|
||||
## Restricts the '/as buy' and '/as rent' commands to the region itself (player needs to be inside).
|
||||
# Restricts buying and renting of regions to the region itself (player needs to be inside the region).
|
||||
restrictedToRegion: false
|
||||
## The UUID of the landlord, this player will receive all money from rents/buys (but not reselling with '/as resell').
|
||||
# The UUID of the landlord, this player will receive all money from rents/buys (but not reselling with '/as resell').
|
||||
landlord: ''
|
||||
## Name of the landlord, if the landlord UUID setting is not provided then the name will be used instead
|
||||
# Name of the landlord, if the landlord UUID setting is not provided then the name will be used instead
|
||||
landlordName: ''
|
||||
|
||||
##### Set the layout and functions of the signs.
|
||||
# The following sections can be added for performing certain commands when the sign is clicked:
|
||||
# rightClickPlayer, rightClickConsole, shiftRightClickPlayer, shiftRightClickConsole,
|
||||
# leftClickPlayer, leftClickConsole, shiftLeftClickPlayer, shiftLeftClickConsole.
|
||||
# Sections with 'Player' at the end will be run by the player that clicks the sign and 'Console' ones from the console.
|
||||
signProfile:
|
||||
forrent:
|
||||
line1: '&2&l[For Rent]'
|
||||
line2: '%region%'
|
||||
line3: '%duration%'
|
||||
line4: '%price%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
rightClickConsole:
|
||||
# - 'areashop message %clicker% %lang:confirm-rent|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
rented:
|
||||
line1: '&4&l[Rented]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4: '%untilshort%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
rightClickConsole:
|
||||
# - 'areashop message %clicker% %lang:confirm-extend|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickConsole:
|
||||
- 'areashop message %clicker% %lang:confirm-unrent|%region%|%'
|
||||
forsale:
|
||||
line1: '&2&l[For Sale]'
|
||||
line2: '%region%'
|
||||
line3: '%price%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
rightClickConsole:
|
||||
# - 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
resell:
|
||||
line1: '&9&l[Resale]'
|
||||
line2: '%region%'
|
||||
line3: '%resellprice%'
|
||||
line4: '&8%player%'
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
rightClickConsole:
|
||||
# - 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop stopresell %region%'
|
||||
sold:
|
||||
line1: '&4&l[Sold]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickConsole:
|
||||
- 'areashop message %clicker% %lang:confirm-sell|%region%|%'
|
||||
|
||||
##### Set WorldGuard regions flags depending on the region state.
|
||||
# All normal region flags as present in WorldGuard can be used, in addition to 'members', 'owners', 'priority' and 'parent'.
|
||||
# The members and owners flag normally take a list of UUID's separated by a comma, adding by name is possible with 'n:<name>'.
|
||||
# You can add groups by using 'g:<groupname>', so an example woul be: '%uuid%, %friendsuuid%, g:vip, n:coolGuy'.
|
||||
# For allow/deny flags like 'entry' and 'exit' you can set the group setting by using 'g:<scope>', <scope> is one of the following:
|
||||
# members, non_members, owners, non_owners, all. Example, only members can enter the region:
|
||||
# entry: 'deny g:non_members'
|
||||
# '' will remove the flag from the region.
|
||||
flagProfile:
|
||||
ALL: # Flags that should always be applied
|
||||
priority: 10
|
||||
members: ''
|
||||
interact: 'deny g:non_members' # Only allow region members/owners to use things in the region (chests, furnace, animals, etc.)
|
||||
build: 'deny g:non_members'
|
||||
forrent:
|
||||
greeting: '%lang:prefix%%lang:greeting-forrent%'
|
||||
rented:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-rented%'
|
||||
forsale:
|
||||
greeting: '%lang:prefix%%lang:greeting-forsale%'
|
||||
sold:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-bought%'
|
||||
resale:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-resale%'
|
||||
|
||||
##### Save and restore schematics to clean up regions.
|
||||
# After 'save:' or 'restore:' you enter the name of the file to restore from/to (.schematic is added automatically).
|
||||
# Set to true to enable saving/restoring for regions as specified in the profile below, which is specified in the config.
|
||||
enableRestore: false
|
||||
schematicProfile:
|
||||
created:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
deleted:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
rented:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
unrented:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
bought:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
sold:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
resell:
|
||||
save: ''
|
||||
restore: ''
|
||||
|
||||
##### Run commands when an event happens.
|
||||
# Commands at a 'before' section will execute before the region details are changed in the AreaShop system
|
||||
# and before any other actions occurred (setting the owner, saving/loading schematics, etc.),
|
||||
# the 'after' commands will be run when all changes are done.
|
||||
# You can add a list of commands to 'before' and 'after'.
|
||||
eventCommandProfile:
|
||||
created:
|
||||
before:
|
||||
after:
|
||||
# - "say An AreaShop region has been created: %region%"
|
||||
deleted:
|
||||
before:
|
||||
after:
|
||||
rented:
|
||||
before:
|
||||
after:
|
||||
extended:
|
||||
before:
|
||||
after:
|
||||
unrented:
|
||||
before:
|
||||
after:
|
||||
bought:
|
||||
before:
|
||||
after:
|
||||
sold:
|
||||
before:
|
||||
after:
|
||||
resell:
|
||||
before:
|
||||
after:
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ RENT: Options for rent regions. │
|
||||
# │ RENT: Settings that apply to rent regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
rent:
|
||||
## The default price of a rental region.
|
||||
# The default price of a rental region.
|
||||
price: 1000
|
||||
## The default duration of a rental region, you can find all time indicators in config.yml below the RENTING header.
|
||||
# The default duration of a rental region, you can find all time indicators in config.yml below the RENTING header.
|
||||
duration: '1 day'
|
||||
## The percentage of the rent price you get back if you unrent the region (price of time left will be multiplied by this/100).
|
||||
# The percentage of the rent price you get back if you unrent the region (price of time left will be multiplied by this/100).
|
||||
moneyBack: 100
|
||||
## Maximum number of extends a player can do (-1 for infinite, 0 for no extending), if they are at this number then
|
||||
## they are force to let their rent run out (and can rent it again at that point).
|
||||
# Maximum number of extends a player can do (-1 for infinite, 0 for no extending), if they are at this number then
|
||||
# they are force to let their rent run out (and can rent it again at that point).
|
||||
maxExtends: -1
|
||||
## The Maximum time they can have the region rented in advance (use times like '1 day' etc, or 'unlimited' for no limit).
|
||||
## This can prevent players from renting their region for a year, and to ensure they periodically have to extend their rent.
|
||||
# The Maximum time they can have the region rented in advance (use times like '1 day' etc, or 'unlimited' for no limit).
|
||||
# This can prevent players from renting their region for a year, and to ensure they periodically have to extend their rent.
|
||||
maxRentTime: 'unlimited'
|
||||
## Automatically unrent the region after the specified time between the last login time of the renter and the current time.
|
||||
## Use times like '1 day' etc, or 'disabled' for never.
|
||||
# Automatically unrent the region after the specified time between the last login time of the renter and the current time.
|
||||
# Use times like '1 day' etc, or 'disabled' for never.
|
||||
inactiveTimeUntilUnrent: 'disabled'
|
||||
## If a region of a player has less then this time left when he joins the server he will get a notice about his region.
|
||||
## Use '' to disable.
|
||||
# If a region of a player has less then this time left when he joins the server he will get a notice about his region.
|
||||
# Use '' to disable.
|
||||
warningOnLoginTime: '1 day'
|
||||
## The profile for the expiration warnings from the 'expirationWarningProfiles' section in the config.
|
||||
expirationWarningProfile: 'default'
|
||||
## If renting the region would go above 'maxRentTIme', then extend to the maximum instead of cancelling the rent.
|
||||
# If renting the region would go above 'maxRentTIme', then extend to the maximum instead of cancelling the rent.
|
||||
extendToFullWhenAboveMaxRentTime: true
|
||||
##### Run commands a certain time before expiration of a region.
|
||||
# Time identifiers specify how much time before the rent is over the commands should be executed.
|
||||
# These commands are executed in a 'best effort' manner, if your server is offline when it should trigger then it won't run.
|
||||
expirationWarningProfile:
|
||||
'1 day':
|
||||
- "areashop message %player% %lang:prefix%%lang:rent-expiringSoon|%region%|%timeleft%|%"
|
||||
'1 hour':
|
||||
- "areashop message %player% %lang:prefix%%lang:rent-expiringSoon|%region%|%timeleft%|%"
|
||||
'5 minutes':
|
||||
- "areashop message %player% %lang:prefix%%lang:rent-expiringSoon|%region%|%timeleft%|%"
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ BUY: Options for buy regions. │
|
||||
# │ BUY: Settings that apply to buy regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
buy:
|
||||
## The default price of a buy region.
|
||||
# The default price of a buy region.
|
||||
price: 1000
|
||||
## The percentage of the price you get back if you sell the region.
|
||||
# The percentage of the price you get back if you sell the region.
|
||||
moneyBack: 100
|
||||
## Automatically sell the region after the specified number of minutes between the last login time of the buyer and the current time
|
||||
## Use times like '1 day' etc, or 'disabled' for never.
|
||||
# Automatically sell the region after the specified number of minutes between the last login time of the buyer and the current time
|
||||
# Use times like '1 day' etc, or 'disabled' for never.
|
||||
inactiveTimeUntilSell: 'disabled'
|
@ -6,38 +6,38 @@
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ TIMERS: Settings to define how often scheduled tasks run. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Setting the 'delay' setting to 0 or lower will prevent the taks from runnning.
|
||||
## The 'delay' settings are specified using a number followed by one of the identifiers as defined in config.yml.
|
||||
## The 'regionsPerTick' settings are to configure how fast something goes, lower value is less lag, but slower updates.
|
||||
## There are 20 ticks in 1 second, so if you set 'regionPerTick' to 5, then 5*20=100 regions per second will be updated.
|
||||
# Setting the 'delay' setting to 0 or lower will prevent the taks from runnning.
|
||||
# The 'delay' settings are specified using a number followed by one of the identifiers as defined in config.yml.
|
||||
# The 'regionsPerTick' settings are to configure how fast something goes, lower value is less lag, but slower updates.
|
||||
# There are 20 ticks in 1 second, so if you set 'regionPerTick' to 5, then 5*20=100 regions per second will be updated.
|
||||
|
||||
## Timings for saving files that need saving.
|
||||
# Timings for saving files that need saving.
|
||||
saving:
|
||||
delay: '10 minutes'
|
||||
delay: '11 minutes'
|
||||
regionsPerTick: 1
|
||||
## Timings for rent expiration checking.
|
||||
# Timings for rent expiration checking.
|
||||
expiration:
|
||||
delay: '59 seconds'
|
||||
delay: '29 seconds'
|
||||
regionsPerTick: 5
|
||||
## Timings for expiration warning to online players.
|
||||
# Timings for expiration warning to online players.
|
||||
expireWarning:
|
||||
delay: '5 minutes'
|
||||
delay: '61 seconds'
|
||||
regionsPerTick: 5
|
||||
## Timings for updating signs and region flags ('/as reload' or after '/as groupadd' or '/as groupdel').
|
||||
# Timings for updating signs and region flags ('/as reload' or after '/as groupadd' or '/as groupdel').
|
||||
update:
|
||||
regionsPerTick: 5
|
||||
## Time between checking if any regions need to be unrented because the player was not online for the specified time period.
|
||||
# Time between checking if any regions need to be unrented because the player was not online for the specified time period.
|
||||
inactive:
|
||||
delay: '15 minutes'
|
||||
delay: '17 minutes'
|
||||
regionsPerTick: 5
|
||||
## Timings for the periodic updating of signs (for timeleft tags etc).
|
||||
# Timings for the periodic updating of signs (for timeleft tags etc).
|
||||
signs:
|
||||
delay: '60 seconds'
|
||||
delay: '1 minute'
|
||||
regionsPerTick: 3
|
||||
## Number of regions per tick to check when a player joins to see if his name changed for regions he owned (updates the regions when changed).
|
||||
# Number of regions per tick to check when a player joins to see if his name changed for regions he owned (updates the regions when changed).
|
||||
nameupdate:
|
||||
regionsPerTick: 10
|
||||
## Timings for adding regions to AreaShop ('/as stack').
|
||||
# Timings for adding regions to AreaShop ('/as stack').
|
||||
adding:
|
||||
regionsPerTick: 2
|
||||
|
||||
@ -45,6 +45,14 @@ adding:
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ OTHER: All other settings. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Allow or disallow extending a rental region when the player is above his limits enforced by the 'limitGroups' section below.
|
||||
## false will ensure a player will eventually lose his region when he has no access anymore.
|
||||
allowRegionExtendsWhenAboveLimits: false
|
||||
# Allow or disallow extending a rental region when the player is above his limits enforced by the 'limitGroups' section below.
|
||||
# false will ensure a player will eventually lose his region when he has no access anymore.
|
||||
allowRegionExtendsWhenAboveLimits: false
|
||||
# Flag profiles that can be used by the 'general.flagProfile' setting in default.yml
|
||||
flagProfiles:
|
||||
# Event command profiles that can be used by the 'general.eventCommandProfile' setting in default.yml
|
||||
eventCommandProfiles:
|
||||
# Sign profiles that can be used by the 'general.signProfile' setting in default.yml
|
||||
signProfiles:
|
||||
# Schematic profiles that can be used by the 'general.schematicProfile' setting in default.yml
|
||||
schematicProfiles:
|
||||
|
@ -116,6 +116,7 @@ rent-maxRentTime: "You cannot rent %lang:region% more time in advance, the maxim
|
||||
rent-restrictedToWorld: "You need to be in the '%world%' world to rent %lang:region% (you are in '%0%')."
|
||||
rent-restrictedToRegion: "You need to be inside %lang:region% to rent it."
|
||||
rent-expireWarning: "Your region %lang:region% has %timeleft% left, be sure to extend it if you want to keep it."
|
||||
rent-expiringSoon: "Your region %lang:tRegion|%0%|% has %1% left, be sure to extend it if you want to keep it."
|
||||
rent-alreadyAtFull: "%lang:region% is already at or above the maximum rental time, you cannot extend it yet."
|
||||
|
||||
buy-help: "/as buy [region], the region you stand in will be used if not specified."
|
||||
@ -285,9 +286,8 @@ info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] You must be inside
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] You need to be inside world '%world%' to rent %lang:region%."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] You must be inside %lang:region% to buy it."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] You need to be inside world '%world%' to buy %lang:region%."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at unrent)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at sell)%0%."
|
||||
info-regionRestoringProfile: " (profile: %0%)"
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at unrent)."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at sell)."
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Landlord: [gray]%lang:landlord% (receives the money)."
|
||||
info-regionNotExisting: "The specified region is not registered: %0%."
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user