Add deprecation warnings.

Also remove the nodes from config if unused.
This commit is contained in:
wizjany 2022-02-27 16:34:27 -05:00
parent de386fb4d8
commit f883899cfe
No known key found for this signature in database
GPG Key ID: 1DB5861C03B76B5E
2 changed files with 16 additions and 0 deletions

View File

@ -178,6 +178,11 @@ public void loadConfiguration() {
simulateSponge = getBoolean("simulation.sponge.enable", false);
spongeRadius = Math.max(1, getInt("simulation.sponge.radius", 3)) - 1;
redstoneSponges = getBoolean("simulation.sponge.redstone", false);
if (simulateSponge) {
log.warning("Sponge simulation is deprecated for removal in a future version. We recommend using CraftBook's sponge simulation instead.");
} else {
config.removeProperty("simulation.sponge");
}
pumpkinScuba = getBoolean("default.pumpkin-scuba", false);
disableHealthRegain = getBoolean("default.disable-health-regain", false);
@ -237,6 +242,11 @@ public void loadConfiguration() {
signChestProtection = getBoolean("chest-protection.enable", false);
disableSignChestProtectionCheck = getBoolean("chest-protection.disable-off-check", false);
if (signChestProtection) {
log.warning("Sign-based chest protection is deprecated for removal in a future version. See https://worldguard.enginehub.org/en/latest/chest-protection/ for details.");
} else {
config.removeProperty("chest-protection");
}
disableCreatureCropTrampling = getBoolean("crops.disable-creature-trampling", false);
disablePlayerCropTrampling = getBoolean("crops.disable-player-trampling", false);

View File

@ -93,6 +93,12 @@ public void load() {
String sqlUsername = config.getString("regions.sql.username", "worldguard");
String sqlPassword = config.getString("regions.sql.password", "worldguard");
String sqlTablePrefix = config.getString("regions.sql.table-prefix", "");
if (!useSqlDatabase) {
config.removeProperty("regions.sql");
} else {
log.warning("SQL support for WorldGuard region storage is deprecated for removal in a future version. Please migrate to YAML storage.");
log.warning("For details, see https://worldguard.enginehub.org/en/latest/regions/storage/");
}
DataSourceConfig dataSourceConfig = new DataSourceConfig(sqlDsn, sqlUsername, sqlPassword, sqlTablePrefix);
SQLDriver sqlDriver = new SQLDriver(dataSourceConfig);