From d4d8cbbc03406a9d25bffb163b0d297b1ed9558b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 20 Mar 2019 21:58:39 -0700 Subject: [PATCH] arcane forging config --- pom.xml | 4 +- .../repair/ConfigRepairArcaneForging.java | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 10f269944..a9f53f868 100755 --- a/pom.xml +++ b/pom.xml @@ -77,9 +77,9 @@ src/main/assembly/package.xml - + diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepairArcaneForging.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepairArcaneForging.java index 13c49af87..f8d9cdf6a 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepairArcaneForging.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepairArcaneForging.java @@ -3,11 +3,40 @@ package com.gmail.nossr50.config.hocon.skills.repair; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; +import java.util.HashMap; + @ConfigSerializable public class ConfigRepairArcaneForging { public static final boolean LOSE_ENCHANTS_DEFAULT = true; public static final boolean DOWNGRADES_ENABLED_DEFAULT = true; + public static final HashMap FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT; + public static final HashMap PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT; + + static { + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT = new HashMap<>(); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT = new HashMap<>(); + + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(1, 2.5); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(2, 5.0); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(3, 7.5); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(4, 10.0); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(5, 12.5); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(6, 17.5); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(7, 25.0); + FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(8, 32.5); + + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(1, 2.0); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(2, 2.5); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(3, 5.0); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(4, 7.5); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(5, 10.0); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(6, 12.5); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(7, 15.0); + PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT.put(8, 17.5); + } + + @Setting(value = "May-Lose-Enchants", comment = "With this on, players have a chance to have enchantments stripped from" + "\n their item when repairing." + "\nThe odds to lose your enchants decrease with higher levels of skill." + @@ -19,6 +48,14 @@ public class ConfigRepairArcaneForging { "\nDefault value: "+DOWNGRADES_ENABLED_DEFAULT) private boolean downgradesEnabled = DOWNGRADES_ENABLED_DEFAULT; + @Setting(value = "Extract-Full-Enchant-Percentage-Chance-Per-Rank", comment = "The chance to extract the enchantment from the item during salvage without any downgrade." + + "\nIf this fails, a check to see if you can extract a downgraded version of the enchantment executes.") + private HashMap extractFullEnchantChance = FULL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT; + + @Setting(value = "Extract-Partial-Enchant-Percentage-Chance-Per-Rank", comment = "The chance to extract a downgraded enchantment from the item during salvage." + + "\nThis check happens if you fail to extract the full enchant from the item.") + private HashMap extractPartialEnchantChance = PARTIAL_ENCHANT_INTEGER_DOUBLE_HASH_MAP_DEFAULT; + public boolean isMayLoseEnchants() { return mayLoseEnchants; } @@ -26,4 +63,12 @@ public class ConfigRepairArcaneForging { public boolean isDowngradesEnabled() { return downgradesEnabled; } + + public HashMap getExtractFullEnchantChance() { + return extractFullEnchantChance; + } + + public HashMap getExtractPartialEnchantChance() { + return extractPartialEnchantChance; + } } \ No newline at end of file