From 413d21d1d89e87c8a81cf3c6131fd97057bb2246 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sun, 18 Aug 2019 22:09:09 +0100 Subject: [PATCH] Add backwards-compatibility to wizard tower rarity, if it's below the new minimum value (which the old default was), it automatically gets reset to the default value of 600. --- src/main/java/electroblob/wizardry/Settings.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java index 8692cc0b..f4e94229 100644 --- a/src/main/java/electroblob/wizardry/Settings.java +++ b/src/main/java/electroblob/wizardry/Settings.java @@ -707,6 +707,10 @@ public final class Settings { towerRarity = property.getInt(); propOrder.add(property.getName()); + // A bit of backwards-compatibility: predictably, people don't read my instructions and update without deleting + // the config, resulting in wizard towers generating everywhere - so let's update it for them! + if(towerRarity < 20) towerRarity = 600; // The old default was 8, which is outside the new allowed range + property = config.get(WORLDGEN_CATEGORY, "evilWizardChance", 0.2, "The chance for wizard towers to generate with an evil wizard and chest inside, instead of a friendly wizard.", 0, 1); property.setLanguageKey("config." + Wizardry.MODID + ".evil_wizard_chance"); property.setRequiresWorldRestart(true);