Added AnnotationConfig support, so config now includes comments
This commit is contained in:
parent
6a9ed1447e
commit
0e495231c5
14
.gitignore
vendored
14
.gitignore
vendored
@ -1,6 +1,8 @@
|
|||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
.settings/*
|
.settings/*
|
||||||
bin/*
|
bin/*
|
||||||
target/*
|
target/*
|
||||||
build.bat
|
build.bat
|
||||||
|
/bin/
|
||||||
|
/target/
|
||||||
|
|||||||
235
pom.xml
235
pom.xml
@ -1,114 +1,123 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>Me.EtienneDx</groupId>
|
<groupId>Me.EtienneDx</groupId>
|
||||||
<artifactId>RealEstate</artifactId>
|
<artifactId>RealEstate</artifactId>
|
||||||
<version>0.2.0-SNAPSHOT</version>
|
<version>0.2.0-SNAPSHOT</version>
|
||||||
<name>RealEstate</name>
|
<name>RealEstate</name>
|
||||||
<description>A spigot plugin for selling, renting and leasing GriefPrevention claims</description>
|
<description>A spigot plugin for selling, renting and leasing GriefPrevention claims</description>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.name}</finalName>
|
<finalName>${project.name}</finalName>
|
||||||
<sourceDirectory>src</sourceDirectory>
|
<sourceDirectory>src</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>.</directory>
|
<directory>.</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<targetPath>.</targetPath>
|
<targetPath>.</targetPath>
|
||||||
<includes>
|
<includes>
|
||||||
<include>plugin.yml</include>
|
<include>plugin.yml</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.8.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.1</version>
|
<version>3.2.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>co.aikar.commands</pattern>
|
<pattern>co.aikar.commands</pattern>
|
||||||
<shadedPattern>me.EtienneDx.RealEstate.acf</shadedPattern>
|
<shadedPattern>me.EtienneDx.RealEstate.acf</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
<relocation>
|
||||||
</configuration>
|
<pattern>me.EtienneDx.AttributeConfig</pattern>
|
||||||
<executions>
|
<shadedPattern>me.EtienneDx.RealEstate.AttributeConfig</shadedPattern>
|
||||||
<execution>
|
</relocation>
|
||||||
<phase>package</phase>
|
</relocations>
|
||||||
<goals>
|
</configuration>
|
||||||
<goal>shade</goal>
|
<executions>
|
||||||
</goals>
|
<execution>
|
||||||
</execution>
|
<phase>package</phase>
|
||||||
</executions>
|
<goals>
|
||||||
</plugin>
|
<goal>shade</goal>
|
||||||
</plugins>
|
</goals>
|
||||||
</build>
|
</execution>
|
||||||
<repositories>
|
</executions>
|
||||||
<repository>
|
</plugin>
|
||||||
<id>spigot-repo</id>
|
</plugins>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
</build>
|
||||||
</repository>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>bungeecord-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://()oss.sonatype.org/content/repositories/snapshots</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>bungeecord-repo</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://()oss.sonatype.org/content/repositories/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>vault-repo</id>
|
<id>jitpack.io</id>
|
||||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>aikar</id>
|
<id>vault-repo</id>
|
||||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||||
</repository>
|
</repository>
|
||||||
<!-- EssentialsX repo -->
|
<repository>
|
||||||
<repository>
|
<id>aikar</id>
|
||||||
<id>ess-repo</id>
|
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||||
<url>https://ci.ender.zone/plugin/repository/everything/</url>
|
</repository>
|
||||||
</repository>
|
<!-- EssentialsX repo -->
|
||||||
</repositories>
|
<repository>
|
||||||
<dependencies>
|
<id>ess-repo</id>
|
||||||
<dependency>
|
<url>https://ci.ender.zone/plugin/repository/everything/</url>
|
||||||
<groupId>org.spigotmc</groupId>
|
</repository>
|
||||||
<artifactId>spigot-api</artifactId>
|
</repositories>
|
||||||
<version>1.14-R0.1-SNAPSHOT</version>
|
<dependencies>
|
||||||
<scope>provided</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>org.spigotmc</groupId>
|
||||||
<dependency>
|
<artifactId>spigot-api</artifactId>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<version>1.14-R0.1-SNAPSHOT</version>
|
||||||
<artifactId>VaultAPI</artifactId>
|
<scope>provided</scope>
|
||||||
<version>1.7</version>
|
</dependency>
|
||||||
<scope>provided</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<dependency>
|
<artifactId>VaultAPI</artifactId>
|
||||||
<groupId>co.aikar</groupId>
|
<version>1.7</version>
|
||||||
<artifactId>acf-bukkit</artifactId>
|
<scope>provided</scope>
|
||||||
<version>0.5.0-SNAPSHOT</version>
|
</dependency>
|
||||||
</dependency>
|
<dependency>
|
||||||
<dependency>
|
<groupId>co.aikar</groupId>
|
||||||
<groupId>net.ess3</groupId>
|
<artifactId>acf-bukkit</artifactId>
|
||||||
<artifactId>EssentialsX</artifactId>
|
<version>0.5.0-SNAPSHOT</version>
|
||||||
<version>2.16.1</version>
|
</dependency>
|
||||||
<scope>provided</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>net.ess3</groupId>
|
||||||
<dependency>
|
<artifactId>EssentialsX</artifactId>
|
||||||
<groupId>com.github.EtienneDx</groupId>
|
<version>2.16.1</version>
|
||||||
<artifactId>GriefPrevention</artifactId>
|
<scope>provided</scope>
|
||||||
<version>master-SNAPSHOT</version>
|
</dependency>
|
||||||
<scope>provided</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>com.github.EtienneDx</groupId>
|
||||||
</dependencies>
|
<artifactId>GriefPrevention</artifactId>
|
||||||
|
<version>master-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.EtienneDx</groupId>
|
||||||
|
<artifactId>AnnotationConfig</artifactId>
|
||||||
|
<version>2c9f016</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
@ -1,182 +1,212 @@
|
|||||||
package me.EtienneDx.RealEstate;
|
package me.EtienneDx.RealEstate;
|
||||||
|
|
||||||
import java.io.File;
|
import java.util.Arrays;
|
||||||
import java.io.IOException;
|
import java.util.List;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.plugin.PluginDescriptionFile;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import me.EtienneDx.AnnotationConfig.AnnotationConfig;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
import me.EtienneDx.AnnotationConfig.ConfigField;
|
||||||
|
import me.EtienneDx.AnnotationConfig.ConfigFile;
|
||||||
public class Config
|
|
||||||
{
|
@ConfigFile(header = "RealEstate wiki and newest versions are available at http://www.github.com/EtienneDx/RealEstate")
|
||||||
public PluginDescriptionFile pdf;
|
public class Config extends AnnotationConfig
|
||||||
|
{
|
||||||
public final String configFilePath = RealEstate.pluginDirPath + "config.yml";
|
public PluginDescriptionFile pdf;
|
||||||
public final String logFilePath = RealEstate.pluginDirPath + "GriefProtection_RealEstate.log";
|
|
||||||
public final String chatPrefix = "[" + ChatColor.GOLD + "RealEstate" + ChatColor.WHITE + "] ";
|
public final String configFilePath = RealEstate.pluginDirPath + "config.yml";
|
||||||
|
public final String logFilePath = RealEstate.pluginDirPath + "GriefProtection_RealEstate.log";
|
||||||
public String cfgSignsHeader;
|
public final String chatPrefix = "[" + ChatColor.GOLD + "RealEstate" + ChatColor.WHITE + "] ";
|
||||||
//public List<String> cfgSigns;
|
|
||||||
|
@ConfigField(name="RealEstate.Keywords.SignsHeader", comment = "What is displayed in top of the signs")
|
||||||
public List<String> cfgSellKeywords;
|
public String cfgSignsHeader = ChatColor.GOLD + "[RealEstate]";
|
||||||
public List<String> cfgRentKeywords;
|
//public List<String> cfgSigns;
|
||||||
public List<String> cfgLeaseKeywords;
|
|
||||||
|
@ConfigField(name="RealEstate.Keywords.Sell", comment = "List of all possible possible signs headers to sell a claim")
|
||||||
public String cfgReplaceSell;
|
public List<String> cfgSellKeywords = Arrays.asList("[sell]", "[sell claim]", "[sc]", "[re]", "[realestate]");
|
||||||
public String cfgReplaceRent;
|
@ConfigField(name="RealEstate.Keywords.Rent", comment = "List of all possible possible signs headers to rent a claim")
|
||||||
public String cfgReplaceLease;
|
public List<String> cfgRentKeywords = Arrays.asList("[rent]", "[rent claim]", "[rc]");
|
||||||
|
@ConfigField(name="RealEstate.Keywords.Lease", comment = "List of all possible possible signs headers to lease a claim")
|
||||||
public boolean cfgEnableSell;
|
public List<String> cfgLeaseKeywords = Arrays.asList("[lease]", "[lease claim]", "[lc]");
|
||||||
public boolean cfgEnableRent;
|
|
||||||
public boolean cfgEnableLease;
|
@ConfigField(name="RealEstate.Keywords.Replace.Sell", comment = "What is displayed on signs for preoperties to sell")
|
||||||
|
public String cfgReplaceSell = "FOR SALE";
|
||||||
public boolean cfgEnableAutoRenew;
|
@ConfigField(name="RealEstate.Keywords.Replace.Rent", comment = "What is displayed on signs for preoperties to rent")
|
||||||
public boolean cfgEnableRentPeriod;
|
public String cfgReplaceRent = "FOR RENT";
|
||||||
public boolean cfgDestroyRentSigns;
|
@ConfigField(name="RealEstate.Keywords.Replace.Lease", comment = "What is displayed on signs for preoperties to lease")
|
||||||
public boolean cfgDestroyLeaseSigns;
|
public String cfgReplaceLease = "FOR LEASE";
|
||||||
|
|
||||||
public boolean cfgTransferClaimBlocks;
|
@ConfigField(name="RealEstate.Rules.Sell", comment = "Is selling claims enabled?")
|
||||||
|
public boolean cfgEnableSell = true;
|
||||||
public boolean cfgUseCurrencySymbol;
|
@ConfigField(name="RealEstate.Rules.Rent", comment = "Is renting claims enabled?")
|
||||||
public String cfgCurrencySymbol;
|
public boolean cfgEnableRent = true;
|
||||||
|
@ConfigField(name="RealEstate.Rules.Lease", comment = "Is leasing claims enabled?")
|
||||||
public boolean cfgMessageOwner;
|
public boolean cfgEnableLease = true;
|
||||||
public boolean cfgMessageBuyer;
|
|
||||||
public boolean cfgBroadcastSell;
|
@ConfigField(name="RealEstate.Rules.AutomaticRenew", comment = "Can players renting claims enable automatic renew of their contracts?")
|
||||||
public boolean cfgMailOffline;
|
public boolean cfgEnableAutoRenew = true;
|
||||||
|
@ConfigField(name="RealEstate.Rules.RentPeriods", comment = "Can a rent contract last multiple periods?")
|
||||||
public double cfgPriceSellPerBlock;
|
public boolean cfgEnableRentPeriod = true;
|
||||||
public double cfgPriceRentPerBlock;
|
@ConfigField(name="RealEstate.Rules.DestroySigns.Rent", comment = "Should the rent signs get destroyed once the claim is rented?")
|
||||||
public double cfgPriceLeasePerBlock;
|
public boolean cfgDestroyRentSigns = false;
|
||||||
|
@ConfigField(name="RealEstate.Rules.DestroySigns.Lease", comment = "Should the lease signs get destroyed once the claim is leased?")
|
||||||
public String cfgRentTime;
|
public boolean cfgDestroyLeaseSigns = true;
|
||||||
public String cfgLeaseTime;
|
|
||||||
|
@ConfigField(name="RealEstate.Rules.TransferClaimBlocks", comment = "Are the claim blocks transfered to the new owner on purchase or should the buyer provide them?")
|
||||||
public int cfgLeasePayments;
|
public boolean cfgTransferClaimBlocks = true;
|
||||||
|
|
||||||
public Config()
|
@ConfigField(name="RealEstate.Rules.UseCurrencySymbol", comment = "Should the signs display the prices with a currency symbol instead of the full currency name?")
|
||||||
{
|
public boolean cfgUseCurrencySymbol = false;
|
||||||
this.pdf = RealEstate.instance.getDescription();
|
@ConfigField(name="RealEstate.Rules.CurrencySymbol", comment = "In case UseCurrencySymbol is true, what symbol should be used?")
|
||||||
}
|
public String cfgCurrencySymbol = "$";
|
||||||
|
|
||||||
public String getString(List<String> li)
|
@ConfigField(name="RealEstate.Messaging.MessageOwner", comment = "Should the owner get messaged once one of his claim is rented/leased/bought and on end of contracts?")
|
||||||
{
|
public boolean cfgMessageOwner = true;
|
||||||
return String.join(";", li);
|
@ConfigField(name="RealEstate.Messaging.MessageBuyer", comment = "Should the buyer get messaged once one of his claim is rented/leased/bought and on end of contracts?")
|
||||||
}
|
public boolean cfgMessageBuyer = true;
|
||||||
|
@ConfigField(name="RealEstate.Messaging.BroadcastSell", comment = "Should a message get broadcasted when a player put a claim for rent/lease/sell?")
|
||||||
public List<String> getList(String str)
|
public boolean cfgBroadcastSell = true;
|
||||||
{
|
@ConfigField(name="RealEstate.Messaging.MailOffline", comment = "Should offline owner/buyers receive mails (using the Essentials plugin) when they're offline?")
|
||||||
return Arrays.asList(str.split(";"));
|
public boolean cfgMailOffline = true;
|
||||||
}
|
|
||||||
|
@ConfigField(name="RealEstate.Default.PricesPerBlock.Sell", comment = "Chat is the default price per block when selling a claim")
|
||||||
List<String> getConfigList(YamlConfiguration config, String path, List<String> defVal)
|
public double cfgPriceSellPerBlock = 5.0;
|
||||||
{
|
@ConfigField(name="RealEstate.Default.PricesPerBlock.Rent", comment = "Chat is the default price per block when renting a claim")
|
||||||
config.addDefault(path, defVal);
|
public double cfgPriceRentPerBlock = 2.0;
|
||||||
List<String> ret = config.getStringList(path);
|
@ConfigField(name="RealEstate.Default.PricesPerBlock.Lease", comment = "Chat is the default price per block when leasing a claim")
|
||||||
ret.replaceAll(String::toLowerCase);
|
public double cfgPriceLeasePerBlock = 2.0;
|
||||||
return ret;
|
|
||||||
}
|
@ConfigField(name="RealEstate.Default.Duration.Rent", comment = "How long is a rent period by default")
|
||||||
|
public String cfgRentTime = "7D";
|
||||||
public void loadConfig(YamlConfiguration config)
|
@ConfigField(name="RealEstate.Default.Duration.Lease", comment = "How long is a lease period by default")
|
||||||
{
|
public String cfgLeaseTime = "7D";
|
||||||
this.cfgSignsHeader = config.getString("RealEstate.Keywords.SignsHeader", ChatColor.GOLD + "[RealEstate]");
|
|
||||||
//this.cfgSigns = getConfigList(config, "RealEstate.Keywords.Signs", Arrays.asList("[re]", "[realestate]"));
|
@ConfigField(name="RealEstate.Default.LeasePaymentsCount", comment = "How many lease periods are required before the buyer gets the claim's ownership by default")
|
||||||
|
public int cfgLeasePayments = 5;
|
||||||
this.cfgSellKeywords = getConfigList(config, "RealEstate.Keywords.Sell", Arrays.asList("[sell]", "[sell claim]", "[sc]", "[re]", "[realestate]"));
|
|
||||||
this.cfgRentKeywords = getConfigList(config, "RealEstate.Keywords.Rent", Arrays.asList("[rent]", "[rent claim]", "[rc]"));
|
public Config()
|
||||||
this.cfgLeaseKeywords = getConfigList(config, "RealEstate.Keywords.Lease", Arrays.asList("[lease]", "[lease claim]", "[lc]"));
|
{
|
||||||
|
this.pdf = RealEstate.instance.getDescription();
|
||||||
this.cfgReplaceSell = config.getString("RealEstate.Keywords.Replace.Sell", "FOR SALE");
|
}
|
||||||
this.cfgReplaceRent = config.getString("RealEstate.Keywords.Replace.Rent", "FOR RENT");
|
|
||||||
this.cfgReplaceLease = config.getString("RealEstate.Keywords.Replace.Lease", "FOR LEASE");
|
public String getString(List<String> li)
|
||||||
|
{
|
||||||
this.cfgEnableSell = config.getBoolean("RealEstate.Rules.Sell", true);
|
return String.join(";", li);
|
||||||
this.cfgEnableRent = config.getBoolean("RealEstate.Rules.Rent", true);
|
}
|
||||||
this.cfgEnableLease = config.getBoolean("RealEstate.Rules.Lease", true);
|
|
||||||
|
public List<String> getList(String str)
|
||||||
this.cfgEnableAutoRenew = config.getBoolean("RealEstate.Rules.AutomaticRenew", true);
|
{
|
||||||
this.cfgEnableRentPeriod = config.getBoolean("RealEstate.Rules.RentPeriods", true);
|
return Arrays.asList(str.split(";"));
|
||||||
this.cfgDestroyRentSigns = config.getBoolean("RealEstate.Rules.DestroySigns.Rent", false);
|
}
|
||||||
this.cfgDestroyLeaseSigns = config.getBoolean("RealEstate.Rules.DestroySigns.Lease", false);
|
|
||||||
|
List<String> getConfigList(YamlConfiguration config, String path, List<String> defVal)
|
||||||
this.cfgTransferClaimBlocks = config.getBoolean("RealEstate.Rules.TransferClaimBlocks", true);
|
{
|
||||||
|
config.addDefault(path, defVal);
|
||||||
this.cfgUseCurrencySymbol = config.getBoolean("RealEstate.Rules.UseCurrencySymbol", false);
|
List<String> ret = config.getStringList(path);
|
||||||
this.cfgCurrencySymbol = config.getString("RealEstate.Rules.CurrencySymbol", "$");
|
ret.replaceAll(String::toLowerCase);
|
||||||
|
return ret;
|
||||||
this.cfgMessageOwner = config.getBoolean("RealEstate.Messaging.MessageOwner", true);
|
}
|
||||||
this.cfgMessageBuyer = config.getBoolean("RealEstate.Messaging.MessageBuyer", true);
|
|
||||||
this.cfgMailOffline = config.getBoolean("RealEstate.Messaging.MailOffline", true);
|
/*public void loadConfig(YamlConfiguration config)
|
||||||
this.cfgBroadcastSell = config.getBoolean("RealEstate.Messaging.BroadcastSell", true);
|
{
|
||||||
|
this.cfgSignsHeader = config.getString("RealEstate.Keywords.SignsHeader", ChatColor.GOLD + "[RealEstate]");
|
||||||
this.cfgPriceSellPerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Sell", 5.0);
|
//this.cfgSigns = getConfigList(config, "RealEstate.Keywords.Signs", Arrays.asList("[re]", "[realestate]"));
|
||||||
this.cfgPriceRentPerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Rent", 2.0);
|
|
||||||
this.cfgPriceLeasePerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Lease", 2.0);
|
this.cfgSellKeywords = getConfigList(config, "RealEstate.Keywords.Sell", Arrays.asList("[sell]", "[sell claim]", "[sc]", "[re]", "[realestate]"));
|
||||||
|
this.cfgRentKeywords = getConfigList(config, "RealEstate.Keywords.Rent", Arrays.asList("[rent]", "[rent claim]", "[rc]"));
|
||||||
this.cfgRentTime = config.getString("RealEstate.Default.Duration.Rent", "7D");
|
this.cfgLeaseKeywords = getConfigList(config, "RealEstate.Keywords.Lease", Arrays.asList("[lease]", "[lease claim]", "[lc]"));
|
||||||
this.cfgLeaseTime = config.getString("RealEstate.Default.Duration.Lease", "7D");
|
|
||||||
|
this.cfgReplaceSell = config.getString("RealEstate.Keywords.Replace.Sell", "FOR SALE");
|
||||||
this.cfgLeasePayments = config.getInt("RealEstate.Default.PaymentsCount.Lease", 5);
|
this.cfgReplaceRent = config.getString("RealEstate.Keywords.Replace.Rent", "FOR RENT");
|
||||||
}
|
this.cfgReplaceLease = config.getString("RealEstate.Keywords.Replace.Lease", "FOR LEASE");
|
||||||
|
|
||||||
public void loadConfig()
|
this.cfgEnableSell = config.getBoolean("RealEstate.Rules.Sell", true);
|
||||||
{
|
this.cfgEnableRent = config.getBoolean("RealEstate.Rules.Rent", true);
|
||||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(new File(this.configFilePath));
|
this.cfgEnableLease = config.getBoolean("RealEstate.Rules.Lease", true);
|
||||||
this.loadConfig(config);
|
|
||||||
}
|
this.cfgEnableAutoRenew = config.getBoolean("RealEstate.Rules.AutomaticRenew", true);
|
||||||
|
this.cfgEnableRentPeriod = config.getBoolean("RealEstate.Rules.RentPeriods", true);
|
||||||
public void saveConfig()
|
this.cfgDestroyRentSigns = config.getBoolean("RealEstate.Rules.DestroySigns.Rent", false);
|
||||||
{
|
this.cfgDestroyLeaseSigns = config.getBoolean("RealEstate.Rules.DestroySigns.Lease", false);
|
||||||
FileConfiguration outConfig = new YamlConfiguration();
|
|
||||||
outConfig.set("RealEstate.Keywords.SignsHeader", this.cfgSignsHeader);
|
this.cfgTransferClaimBlocks = config.getBoolean("RealEstate.Rules.TransferClaimBlocks", true);
|
||||||
//outConfig.set("RealEstate.Keywords.Signs", this.cfgSigns);
|
|
||||||
|
this.cfgUseCurrencySymbol = config.getBoolean("RealEstate.Rules.UseCurrencySymbol", false);
|
||||||
outConfig.set("RealEstate.Keywords.Sell", this.cfgSellKeywords);
|
this.cfgCurrencySymbol = config.getString("RealEstate.Rules.CurrencySymbol", "$");
|
||||||
outConfig.set("RealEstate.Keywords.Rent", this.cfgRentKeywords);
|
|
||||||
outConfig.set("RealEstate.Keywords.Lease", this.cfgLeaseKeywords);
|
this.cfgMessageOwner = config.getBoolean("RealEstate.Messaging.MessageOwner", true);
|
||||||
|
this.cfgMessageBuyer = config.getBoolean("RealEstate.Messaging.MessageBuyer", true);
|
||||||
outConfig.set("RealEstate.Keywords.Replace.Sell", this.cfgReplaceSell);
|
this.cfgMailOffline = config.getBoolean("RealEstate.Messaging.MailOffline", true);
|
||||||
outConfig.set("RealEstate.Keywords.Replace.Rent", this.cfgReplaceRent);
|
this.cfgBroadcastSell = config.getBoolean("RealEstate.Messaging.BroadcastSell", true);
|
||||||
outConfig.set("RealEstate.Keywords.Replace.Lease", this.cfgReplaceLease);
|
|
||||||
|
this.cfgPriceSellPerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Sell", 5.0);
|
||||||
outConfig.set("RealEstate.Rules.Sell", this.cfgEnableSell);
|
this.cfgPriceRentPerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Rent", 2.0);
|
||||||
outConfig.set("RealEstate.Rules.Rent", this.cfgEnableRent);
|
this.cfgPriceLeasePerBlock = config.getDouble("RealEstate.Default.PricesPerBlock.Lease", 2.0);
|
||||||
outConfig.set("RealEstate.Rules.Lease", this.cfgEnableLease);
|
|
||||||
|
this.cfgRentTime = config.getString("RealEstate.Default.Duration.Rent", "7D");
|
||||||
outConfig.set("RealEstate.Rules.AutomaticRenew", this.cfgEnableAutoRenew);
|
this.cfgLeaseTime = config.getString("RealEstate.Default.Duration.Lease", "7D");
|
||||||
outConfig.set("RealEstate.Rules.RentPeriods", this.cfgEnableRentPeriod);
|
|
||||||
outConfig.set("RealEstate.Rules.DestroySigns.Rent", this.cfgDestroyRentSigns);
|
this.cfgLeasePayments = config.getInt("RealEstate.Default.PaymentsCount.Lease", 5);
|
||||||
outConfig.set("RealEstate.Rules.DestroySigns.Lease", this.cfgDestroyLeaseSigns);
|
}*/
|
||||||
|
|
||||||
outConfig.set("RealEstate.Rules.TransferClaimBlocks", this.cfgTransferClaimBlocks);
|
@Override
|
||||||
|
public void loadConfig()
|
||||||
outConfig.set("RealEstate.Rules.UseCurrencySymbol", this.cfgUseCurrencySymbol);
|
{
|
||||||
outConfig.set("RealEstate.Rules.CurrencySymbol", this.cfgCurrencySymbol);
|
//YamlConfiguration config = YamlConfiguration.loadConfiguration(new File(this.configFilePath));
|
||||||
|
this.loadConfig(this.configFilePath);
|
||||||
outConfig.set("RealEstate.Messaging.MessageOwner", this.cfgMessageOwner);
|
}
|
||||||
outConfig.set("RealEstate.Messaging.MessageBuyer", this.cfgMessageBuyer);
|
|
||||||
outConfig.set("RealEstate.Messaging.MailOffline", this.cfgMailOffline);
|
/*public void saveConfig()
|
||||||
outConfig.set("RealEstate.Messaging.BroadcastSell", this.cfgBroadcastSell);
|
{
|
||||||
|
FileConfiguration outConfig = new YamlConfiguration();
|
||||||
outConfig.set("RealEstate.Default.PricePerBlock.Sell", this.cfgPriceSellPerBlock);
|
outConfig.set("RealEstate.Keywords.SignsHeader", this.cfgSignsHeader);
|
||||||
outConfig.set("RealEstate.Default.PricePerBlock.Rent", this.cfgPriceRentPerBlock);
|
//outConfig.set("RealEstate.Keywords.Signs", this.cfgSigns);
|
||||||
outConfig.set("RealEstate.Default.PricePerBlock.Lease", this.cfgPriceLeasePerBlock);
|
|
||||||
|
outConfig.set("RealEstate.Keywords.Sell", this.cfgSellKeywords);
|
||||||
outConfig.set("RealEstate.Default.Duration.Rent", this.cfgRentTime);
|
outConfig.set("RealEstate.Keywords.Rent", this.cfgRentKeywords);
|
||||||
outConfig.set("RealEstate.Default.Duration.Lease", this.cfgLeaseTime);
|
outConfig.set("RealEstate.Keywords.Lease", this.cfgLeaseKeywords);
|
||||||
|
|
||||||
outConfig.set("RealEstate.Default.PaymentsCount.Lease", this.cfgLeasePayments);
|
outConfig.set("RealEstate.Keywords.Replace.Sell", this.cfgReplaceSell);
|
||||||
|
outConfig.set("RealEstate.Keywords.Replace.Rent", this.cfgReplaceRent);
|
||||||
try
|
outConfig.set("RealEstate.Keywords.Replace.Lease", this.cfgReplaceLease);
|
||||||
{
|
|
||||||
outConfig.save(this.configFilePath);
|
outConfig.set("RealEstate.Rules.Sell", this.cfgEnableSell);
|
||||||
}
|
outConfig.set("RealEstate.Rules.Rent", this.cfgEnableRent);
|
||||||
catch (IOException exception)
|
outConfig.set("RealEstate.Rules.Lease", this.cfgEnableLease);
|
||||||
{
|
|
||||||
RealEstate.instance.log.info("Unable to write to the configuration file at \"" + this.configFilePath + "\"");
|
outConfig.set("RealEstate.Rules.AutomaticRenew", this.cfgEnableAutoRenew);
|
||||||
}
|
outConfig.set("RealEstate.Rules.RentPeriods", this.cfgEnableRentPeriod);
|
||||||
}
|
outConfig.set("RealEstate.Rules.DestroySigns.Rent", this.cfgDestroyRentSigns);
|
||||||
}
|
outConfig.set("RealEstate.Rules.DestroySigns.Lease", this.cfgDestroyLeaseSigns);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Rules.TransferClaimBlocks", this.cfgTransferClaimBlocks);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Rules.UseCurrencySymbol", this.cfgUseCurrencySymbol);
|
||||||
|
outConfig.set("RealEstate.Rules.CurrencySymbol", this.cfgCurrencySymbol);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Messaging.MessageOwner", this.cfgMessageOwner);
|
||||||
|
outConfig.set("RealEstate.Messaging.MessageBuyer", this.cfgMessageBuyer);
|
||||||
|
outConfig.set("RealEstate.Messaging.MailOffline", this.cfgMailOffline);
|
||||||
|
outConfig.set("RealEstate.Messaging.BroadcastSell", this.cfgBroadcastSell);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Default.PricePerBlock.Sell", this.cfgPriceSellPerBlock);
|
||||||
|
outConfig.set("RealEstate.Default.PricePerBlock.Rent", this.cfgPriceRentPerBlock);
|
||||||
|
outConfig.set("RealEstate.Default.PricePerBlock.Lease", this.cfgPriceLeasePerBlock);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Default.Duration.Rent", this.cfgRentTime);
|
||||||
|
outConfig.set("RealEstate.Default.Duration.Lease", this.cfgLeaseTime);
|
||||||
|
|
||||||
|
outConfig.set("RealEstate.Default.PaymentsCount.Lease", this.cfgLeasePayments);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
outConfig.save(this.configFilePath);
|
||||||
|
}
|
||||||
|
catch (IOException exception)
|
||||||
|
{
|
||||||
|
RealEstate.instance.log.info("Unable to write to the configuration file at \"" + this.configFilePath + "\"");
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user