AE enchants are now kept by defaulting when upgrading/rerolling etc.

This commit is contained in:
Jules 2024-04-18 16:19:34 -07:00
parent 56b92eebbf
commit fb134b8cd0
3 changed files with 18 additions and 18 deletions

View File

@ -99,19 +99,19 @@ public class ReforgeOptions {
keepTier = config.contains("tier") ? config.getBoolean("tier", true) : null;
}
public ReforgeOptions(boolean... values) {
keepName = arr(values, 0);
keepLore = arr(values, 1);
keepEnchantments = arr(values, 2);
keepUpgrades = arr(values, 3);
keepGemStones = arr(values, 4);
keepSoulBind = arr(values, 5);
keepExternalSH = arr(values, 6);
reRoll = arr(values, 7);
keepModifications = arr(values, 8);
keepAdvancedEnchantments = arr(values, 9);
keepSkins = arr(values, 10);
keepTier = arr(values, 11);
public ReforgeOptions() {
keepName = false;
keepLore = false;
keepEnchantments = true;
keepUpgrades = true;
keepGemStones = true;
keepSoulBind = true;
keepExternalSH = true;
reRoll = false;
keepModifications = true;
keepAdvancedEnchantments = true;
keepSkins = true;
keepTier = true;
}
boolean arr(@NotNull boolean[] booleans, int idx) {

View File

@ -447,12 +447,12 @@ public class MMOItemReforger {
@Deprecated
void regenerate(@Nullable RPGPlayer p) {
reforge(new ReforgeOptions(false, false, false, false, false, false, false, true), p);
reforge(new ReforgeOptions(), p);
}
@Deprecated
int regenerate(@Nullable RPGPlayer player, @NotNull MMOItemTemplate template) {
reforge(new ReforgeOptions(false, false, false, false, false, false, false, true), player);
reforge(new ReforgeOptions(), player);
return 0;
}

View File

@ -192,9 +192,9 @@ public class ConfigManager implements Reloadable {
ConfigurationSection phatLoots = MMOItems.plugin.getConfig().getConfigurationSection("item-revision.phat-loots");
ConfigurationSection gemKeepData = MMOItems.plugin.getConfig().getConfigurationSection("item-revision.keep-gem-data");
ReforgeOptions.dropRestoredGems = MMOItems.plugin.getConfig().getBoolean("item-revision.drop-extra-gems", true);
revisionOptions = keepData != null ? new ReforgeOptions(keepData) : new ReforgeOptions(false, false, false, false, false, false, false, true);
gemRevisionOptions = gemKeepData != null ? new ReforgeOptions(gemKeepData) : new ReforgeOptions(false, false, false, false, false, false, false, true);
phatLootsOptions = phatLoots != null ? new ReforgeOptions(phatLoots) : new ReforgeOptions(false, false, false, false, false, false, false, true);
revisionOptions = keepData != null ? new ReforgeOptions(keepData) : new ReforgeOptions();
gemRevisionOptions = gemKeepData != null ? new ReforgeOptions(gemKeepData) : new ReforgeOptions();
phatLootsOptions = phatLoots != null ? new ReforgeOptions(phatLoots) : new ReforgeOptions();
List<String> exemptedPhatLoots = MMOItems.plugin.getConfig().getStringList("item-revision.disable-phat-loot");
for (String epl : exemptedPhatLoots)