Finishing touches on Repair Config

This commit is contained in:
nossr50 2019-03-22 17:09:22 -07:00
parent e232bb3699
commit 6e83763f22
7 changed files with 67 additions and 29 deletions

View File

@ -51,7 +51,7 @@ public class RepairableSerializer implements TypeSerializer<SimpleRepairable> {
Material repairItem = (Material) getEnum(repairConstant, TypeToken.of(Material.class));*/
int minimumQuantity = value.getNode("Minimum-Quantity-Used-To-Repair").getValue(TypeToken.of(Integer.class));
int minimumLevel = value.getNode("Skill-Level-Required-To-Repair").getValue(TypeToken.of(Integer.class));
int minimumLevel = value.getNode("Override-Level-Requirement").getValue(TypeToken.of(Integer.class));
double xpMultiplier = value.getNode("XP-Multiplier").getValue(TypeToken.of(Double.class));
return new SimpleRepairable(item, repairItems, minimumQuantity, minimumLevel, xpMultiplier);

View File

@ -15,7 +15,7 @@ public class ConfigScalingSubSkillRetro {
@Setting(value = "Max-Bonus-Level", comment = "Max bonus level is the level a player needs to reach in this skill to receive maximum benefits, such as better RNG odds or otherwise." +
"\nSkills dynamically adjust their rewards to match the max bonus level, you can think of it as a curve that calculates what bonuses " +
"\n a player should have based on how far they are from the max bonus level value, and the other parameters used for the scaling of the sub-skill." +
"\nNote: This is the setting for RETRO MODE!" +
"\n\nNote: This is the setting for RETRO MODE!" +
"\nDefault value: "+MAX_BONUS_LEVEL_DEFAULT)
private int maxBonusLevel = MAX_BONUS_LEVEL_DEFAULT;
@ -25,7 +25,7 @@ public class ConfigScalingSubSkillRetro {
"\nMax skill chance is dynamically adjusted based on the players level difference from the \"Max-Bonus-Level\", you can think of it as a curve where reaching \"Max-Bonus-Level\" is the peak." +
"\nAs an example, imagine \"Max-Success-Chance\" was set to " + FIFTY_PERCENT_EXAMPLE + " and the \"Max-Bonus-Level\" was " + MAX_BONUS_LEVEL_EXAMPLE + "," +
"\n and the player was level " + FIFTY_PERCENT_EXAMPLE + " for this skill, that would give the player " + ODDS_PERCENTAGE_EXAMPLE + " odds to succeed with this skill." +
"\nNote: This is the setting for RETRO MODE!" +
"\n\nNote: This is the setting for RETRO MODE!" +
"\nDefault value: "+CHANCE_AT_MAX_SKILL_DEFAULT)
private double chanceAtMaxSkill = CHANCE_AT_MAX_SKILL_DEFAULT;

View File

@ -15,7 +15,7 @@ public class ConfigScalingSubSkillStandard {
@Setting(value = "Max-Bonus-Level", comment = "Max bonus level is the level a player needs to reach in this skill to receive maximum benefits, such as better RNG odds or otherwise." +
"\nSkills dynamically adjust their rewards to match the max bonus level, you can think of it as a curve that calculates what bonuses " +
"\n a player should have based on how far they are from the max bonus level value, and the other parameters used for the scaling of the sub-skill." +
"\nNote: This is the setting for STANDARD MODE!" +
"\n\nNote: This is the setting for STANDARD MODE!" +
"\nDefault value: "+MAX_BONUS_LEVEL_DEFAULT)
private int maxBonusLevel = MAX_BONUS_LEVEL_DEFAULT;
@ -25,7 +25,7 @@ public class ConfigScalingSubSkillStandard {
"\nMax skill chance is dynamically adjusted based on the players level difference from the \"Max-Bonus-Level\", you can think of it as a curve where reaching \"Max-Bonus-Level\" is the peak." +
"\nAs an example, imagine \"Max-Success-Chance\" was set to " + FIFTY_PERCENT_EXAMPLE + " and the \"Max-Bonus-Level\" was " + MAX_BONUS_LEVEL_EXAMPLE + "," +
"\n and the player was level " + FIFTY_PERCENT_EXAMPLE + " for this skill, that would give the player " + ODDS_PERCENTAGE_EXAMPLE + " odds to succeed with this skill." +
"\nNote: This is the setting for STANDARD MODE!" +
"\n\nNote: This is the setting for STANDARD MODE!" +
"\nDefault value: "+CHANCE_AT_MAX_SKILL_DEFAULT)
private double chanceAtMaxSkill = CHANCE_AT_MAX_SKILL_DEFAULT;

View File

@ -10,7 +10,7 @@ public class ConfigSubSkillScalingRNG {
@Setting(value = "Standard-Mode-Scaling-Settings", comment = "Standard mode is the new default level scaling for mcMMO" +
"\nMost skills in standard mode scale from 1-100, maxing out at 100." +
"\nStandard scaling is fairly new, and it replaced the previous scaling method which is now known as RetroMode scaling." +
"\nYou are either using Standard or Retro mode on your server, which one you are using is setup in the leveling config file." +
"\n\nYou are either using Standard or Retro mode on your server, which one you are using is setup in the leveling config file." +
"\nSettings from here are only applied when using Standard mode scaling.")
private ConfigScalingSubSkillStandard standardSettings = new ConfigScalingSubSkillStandard();
@ -19,7 +19,7 @@ public class ConfigSubSkillScalingRNG {
"\nRetro scaling was the main method of scaling in mcMMO for almost 8 years," +
"\n and it was replaced in 2.1 with the new 1-100 scaling method which is known as Standard mode scaling." +
"\nYou can still use Retro Mode scaling, it will never be removed from mcMMO so do not worry about using it!" +
"\nYou are either using Standard or Retro mode on your server, which one you are using is setup in the leveling config file." +
"\n\nYou are either using Standard or Retro mode on your server, which one you are using is setup in the leveling config file." +
"\nSettings from here are only applied when using Retro mode scaling.")
private ConfigScalingSubSkillRetro retroSettings = new ConfigScalingSubSkillRetro();

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.config.hocon.skills.repair;
import com.gmail.nossr50.config.hocon.skills.repair.general.ConfigRepairGeneral;
import com.gmail.nossr50.config.hocon.skills.repair.repairmastery.ConfigRepairMastery;
import com.gmail.nossr50.config.hocon.skills.repair.subskills.ConfigRepairSubSkills;
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairable;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ -70,37 +71,42 @@ public class ConfigRepair {
}
@Setting(value = "Repair-Mastery", comment = "Settings related to the repair mastery subskill")
private ConfigRepairMastery repairMastery = new ConfigRepairMastery();
@Setting(value = "Super-Repair", comment = "Settings related to the super repair subskill")
private ConfigRepairSuperRepair superRepair = new ConfigRepairSuperRepair();
@Setting(value = "Arcane-Forging", comment = "Settings related to the arcane forging subskill")
private ConfigRepairArcaneForging arcaneForging = new ConfigRepairArcaneForging();
@Setting(value = "General")
private ConfigRepairGeneral repairGeneral = new ConfigRepairGeneral();
@Setting(value = "Repairables")
@Setting(value = "SubSkills", comment = "Settings for subskills stemming from Repair")
private ConfigRepairSubSkills repairSubSkills = new ConfigRepairSubSkills();
@Setting(value = "Z-Repairables", comment = "This is the list of what can be repaired in mcMMO by Anvils and their properties." +
"\nThe \"Z\" in this config keys name is literally just to place this at the bottom of the config since the serializer uses alphabetical sorting." +
"\n\n -- Explanation for Parameters --" +
"\nItem: The name of the item, this has to be equivalent to the internal registry key (Name ID) Minecraft uses for this item" +
"\nItems-Used-To-Repair: The name of the item consumed as part of repairing, this has to be equivalent to the internal registry key (Name ID) Minecraft uses for this item" +
"\nMinimum-Quantity-Used-To-Repair: The amount of this item that is required to repair this item at a minimum." +
"\nOverride-Level-Requirement: If you would like to specify a specific skill level required to repair an item, do it here. It should be noted that a lot of items will be given automatic level requirements if you leave this at zero." +
"\nXP-Multiplier: When calculating how much XP to give the player for the repair, the end result will be multiplied by this value." +
"\n\nName ID List: https://minecraft.gamepedia.com/Java_Edition_data_values" +
"\nTIP: You can omit \"minecraft:\" from the Name ID if you want to, for example you can write \"red_wool\" instead of \"minecraft:red_wool\"")
private ArrayList<SimpleRepairable> configRepairablesList = CONFIG_REPAIRABLES_DEFAULTS;
public ConfigRepairGeneral getRepairGeneral() {
return repairGeneral;
}
public ConfigRepairSubSkills getRepairSubSkills() {
return repairSubSkills;
}
public ConfigRepairMastery getRepairMastery() {
return repairMastery;
return repairSubSkills.getRepairMastery();
}
public ConfigRepairSuperRepair getSuperRepair() {
return superRepair;
return repairSubSkills.getSuperRepair();
}
public ConfigRepairArcaneForging getArcaneForging() {
return arcaneForging;
return repairSubSkills.getArcaneForging();
}
public ArrayList<SimpleRepairable> getConfigRepairablesList() {

View File

@ -0,0 +1,32 @@
package com.gmail.nossr50.config.hocon.skills.repair.subskills;
import com.gmail.nossr50.config.hocon.skills.repair.ConfigRepairArcaneForging;
import com.gmail.nossr50.config.hocon.skills.repair.ConfigRepairSuperRepair;
import com.gmail.nossr50.config.hocon.skills.repair.repairmastery.ConfigRepairMastery;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigRepairSubSkills {
@Setting(value = "Repair-Mastery", comment = "Settings related to the repair mastery subskill")
private ConfigRepairMastery repairMastery = new ConfigRepairMastery();
@Setting(value = "Super-Repair", comment = "Settings related to the super repair subskill")
private ConfigRepairSuperRepair superRepair = new ConfigRepairSuperRepair();
@Setting(value = "Arcane-Forging", comment = "Settings related to the arcane forging subskill")
private ConfigRepairArcaneForging arcaneForging = new ConfigRepairArcaneForging();
public ConfigRepairMastery getRepairMastery() {
return repairMastery;
}
public ConfigRepairSuperRepair getSuperRepair() {
return superRepair;
}
public ConfigRepairArcaneForging getArcaneForging() {
return arcaneForging;
}
}