mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Wire up Repair XP values
This commit is contained in:
parent
591c9e67a3
commit
ab4b4edb1a
@ -2,6 +2,7 @@ package com.gmail.nossr50.config.hocon.experience;
|
||||
|
||||
import com.gmail.nossr50.datatypes.experience.CustomXPPerk;
|
||||
import com.gmail.nossr50.datatypes.experience.SpecialXPKey;
|
||||
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ -103,8 +104,8 @@ public class ConfigExperience {
|
||||
return getConfigExperienceSkills().getSmeltingExperienceMap();
|
||||
}
|
||||
|
||||
public HashMap<String, Float> getItemMaterialXPMultiplier() {
|
||||
return getConfigExperienceSkills().getItemMaterialXPMultiplier();
|
||||
public float getItemMaterialXPMultiplier(ItemMaterialCategory itemMaterialCategory) {
|
||||
return getConfigExperienceSkills().getItemMaterialXPMultiplier(itemMaterialCategory);
|
||||
}
|
||||
|
||||
public Float getRepairXPBase() {
|
||||
|
@ -11,24 +11,24 @@ public class ConfigExperienceRepair {
|
||||
|
||||
private static final float REPAIR_XP_BASE_DEFAULT = 1000.0F;
|
||||
|
||||
private static final HashMap<String, Float> ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT;
|
||||
private static final HashMap<ItemMaterialCategory, Float> ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT;
|
||||
|
||||
static {
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT = new HashMap<>();
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.WOOD.toString(), 0.6F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.STONE.toString(), 1.3F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.IRON.toString(), 2.5F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.GOLD.toString(), 0.3F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.DIAMOND.toString(), 5.0F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.LEATHER.toString(), 1.6F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.STRING.toString(), 1.8F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.OTHER.toString(), 1.5F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.WOOD, 0.6F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.STONE, 1.3F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.IRON, 2.5F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.GOLD, 0.3F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.DIAMOND, 5.0F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.LEATHER, 1.6F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.STRING, 1.8F);
|
||||
ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT.put(ItemMaterialCategory.OTHER, 1.5F);
|
||||
}
|
||||
|
||||
@Setting(value = "Item-Material-Category-XP-Multiplier", comment = "The material of your item is determined by mcMMO and used to influence XP, " +
|
||||
"if your Item doesn't fit into a known category it will use OTHER." +
|
||||
"\nFor the most part, items belong to categories of materials that they are made out of.")
|
||||
private HashMap<String, Float> itemMaterialXPMultiplier = ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT;
|
||||
private HashMap<ItemMaterialCategory, Float> itemMaterialXPMultiplier = ITEM_MATERIAL_XP_MULTIPLIER_DEFAULT;
|
||||
|
||||
@Setting(value = "Repair-XP-Base", comment = "The base amount of XP for repairing an item." +
|
||||
"\nThe repair XP formula is a simple multiplication of these 4 values in this order" +
|
||||
@ -39,8 +39,8 @@ public class ConfigExperienceRepair {
|
||||
"\nDefault value: " + REPAIR_XP_BASE_DEFAULT)
|
||||
private Float repairXPBase = REPAIR_XP_BASE_DEFAULT;
|
||||
|
||||
public HashMap<String, Float> getItemMaterialXPMultiplier() {
|
||||
return itemMaterialXPMultiplier;
|
||||
public float getItemMaterialXPMultiplier(ItemMaterialCategory itemMaterialCategory) {
|
||||
return itemMaterialXPMultiplier.get(itemMaterialCategory);
|
||||
}
|
||||
|
||||
public Float getRepairXPBase() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.config.hocon.experience;
|
||||
|
||||
import com.gmail.nossr50.datatypes.experience.SpecialXPKey;
|
||||
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ -108,8 +109,8 @@ public class ConfigExperienceSkills {
|
||||
return experienceSmelting.getSmeltingExperienceMap();
|
||||
}
|
||||
|
||||
public HashMap<String, Float> getItemMaterialXPMultiplier() {
|
||||
return experienceRepair.getItemMaterialXPMultiplier();
|
||||
public float getItemMaterialXPMultiplier(ItemMaterialCategory itemMaterialCategory) {
|
||||
return experienceRepair.getItemMaterialXPMultiplier(itemMaterialCategory);
|
||||
}
|
||||
|
||||
public float getRepairXPBase() {
|
||||
|
@ -176,8 +176,8 @@ public class RepairManager extends SkillManager {
|
||||
// Give out XP like candy
|
||||
applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability())
|
||||
* repairable.getXpMultiplier())
|
||||
* ExperienceConfig.getInstance().getRepairXPBase()
|
||||
* ExperienceConfig.getInstance().getRepairXP(repairable.getRepairItemMaterialCategory())), XPGainReason.PVE);
|
||||
* mcMMO.getConfigManager().getConfigExperience().getRepairXPBase())
|
||||
* mcMMO.getConfigManager().getConfigExperience().getExperienceRepair().getItemMaterialXPMultiplier(repairable.getRepairItemMaterialCategory()), XPGainReason.PVE);
|
||||
|
||||
// BWONG BWONG BWONG
|
||||
if (mcMMO.getConfigManager().getConfigRepair().getRepairGeneral().isAnvilUseSounds()) {
|
||||
|
Loading…
Reference in New Issue
Block a user