mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
Refactoring Salvageables/Repairables, removing Simple from the naming schemes
This commit is contained in:
@ -1,15 +1,12 @@
|
||||
package com.gmail.nossr50.config;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.woodcutting.Woodcutting;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import com.google.common.io.Files;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
|
||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -46,10 +46,10 @@ import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairable;
|
||||
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
|
||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||
import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.SalvageableManager;
|
||||
import com.gmail.nossr50.util.experience.ExperienceMapManager;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
@ -83,8 +83,8 @@ public final class ConfigManager {
|
||||
|
||||
/* COLLECTION MANAGERS */
|
||||
|
||||
private SimpleRepairableManager simpleRepairableManager;
|
||||
private SimpleSalvageableManager simpleSalvageableManager;
|
||||
private RepairableManager repairableManager;
|
||||
private SalvageableManager salvageableManager;
|
||||
|
||||
/* MOD MANAGERS */
|
||||
|
||||
@ -155,7 +155,7 @@ public final class ConfigManager {
|
||||
private SoundConfig soundConfig;
|
||||
private RankConfig rankConfig;
|
||||
// private RepairConfig repairConfig;
|
||||
private SalvageConfig salvageConfig;
|
||||
// private SalvageConfig salvageConfig;
|
||||
|
||||
private HashMap<Material, Integer> partyItemWeights;
|
||||
private HashMap<PartyFeature, Integer> partyFeatureUnlocks;
|
||||
@ -215,7 +215,7 @@ public final class ConfigManager {
|
||||
|
||||
TypeSerializers.getDefaultSerializers().registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer());
|
||||
TypeSerializers.getDefaultSerializers().registerType(new TypeToken<PartyFeature>() {}, new CustomEnumValueSerializer());
|
||||
TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(SimpleRepairable.class), new RepairableSerializer());
|
||||
TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(Repairable.class), new RepairableSerializer());
|
||||
|
||||
mcMMO.p.getLogger().info("Deserializing configs...");
|
||||
//TODO: Not sure about the order of MainConfig
|
||||
@ -287,7 +287,7 @@ public final class ConfigManager {
|
||||
|
||||
// repairConfig = new RepairConfig();
|
||||
|
||||
salvageConfig = new SalvageConfig();
|
||||
// salvageConfig = new SalvageConfig();
|
||||
|
||||
/*
|
||||
* Managers
|
||||
@ -326,19 +326,19 @@ public final class ConfigManager {
|
||||
private void initCollectionManagers()
|
||||
{
|
||||
// Handles registration of repairables
|
||||
simpleRepairableManager = new SimpleRepairableManager(getRepairables());
|
||||
unloadables.add(simpleRepairableManager);
|
||||
repairableManager = new RepairableManager(getRepairables());
|
||||
unloadables.add(repairableManager);
|
||||
|
||||
// Handles registration of salvageables
|
||||
simpleSalvageableManager = new SimpleSalvageableManager(getSalvageables());
|
||||
unloadables.add(simpleSalvageableManager);
|
||||
salvageableManager = new SalvageableManager(getSalvageables());
|
||||
unloadables.add(salvageableManager);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all loaded repairables (loaded from all repairable configs)
|
||||
* @return the currently loaded repairables
|
||||
*/
|
||||
public ArrayList<SimpleRepairable> getRepairables()
|
||||
public ArrayList<Repairable> getRepairables()
|
||||
{
|
||||
return getConfigRepair().getConfigRepairablesList();
|
||||
}
|
||||
@ -349,7 +349,7 @@ public final class ConfigManager {
|
||||
*/
|
||||
public ArrayList<Salvageable> getSalvageables()
|
||||
{
|
||||
return (ArrayList<Salvageable>) salvageConfig.genericCollection;
|
||||
return getConfigSalvage().getConfigSalvageablesList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -401,12 +401,12 @@ public final class ConfigManager {
|
||||
return userFiles;
|
||||
}
|
||||
|
||||
public SimpleRepairableManager getSimpleRepairableManager() {
|
||||
return simpleRepairableManager;
|
||||
public RepairableManager getRepairableManager() {
|
||||
return repairableManager;
|
||||
}
|
||||
|
||||
public SimpleSalvageableManager getSimpleSalvageableManager() {
|
||||
return simpleSalvageableManager;
|
||||
public SalvageableManager getSalvageableManager() {
|
||||
return salvageableManager;
|
||||
}
|
||||
|
||||
public MainConfig getMainConfig() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.config.hocon;
|
||||
|
||||
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairable;
|
||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
|
||||
@ -10,7 +10,7 @@ import ninja.leaping.configurate.util.EnumLookup;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class RepairableSerializer implements TypeSerializer<SimpleRepairable> {
|
||||
public class RepairableSerializer implements TypeSerializer<Repairable> {
|
||||
|
||||
/*
|
||||
TypeTokens are obtained in two ways
|
||||
@ -32,13 +32,13 @@ public class RepairableSerializer implements TypeSerializer<SimpleRepairable> {
|
||||
|
||||
|
||||
@Override
|
||||
public SimpleRepairable deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
|
||||
public Repairable deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
|
||||
|
||||
/*
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_SWORD, OAK_PLANKS, 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_SWORD, OAK_PLANKS, 1, 0, .25D));
|
||||
*/
|
||||
|
||||
/* SimpleRepairable(Material itemMaterial, Material repairMaterial, int minimumQuantity, int minimumLevel, double xpMultiplier) */
|
||||
/* Repairable(Material itemMaterial, Material repairMaterial, int minimumQuantity, int minimumLevel, double xpMultiplier) */
|
||||
|
||||
String item = value.getNode("Item").getValue(TypeToken.of(String.class));
|
||||
List<String> repairItems = value.getNode("Items-Used-To-Repair").getValue(new TypeToken<List<String>>() {});
|
||||
@ -54,11 +54,11 @@ public class RepairableSerializer implements TypeSerializer<SimpleRepairable> {
|
||||
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);
|
||||
return new Repairable(item, repairItems, minimumQuantity, minimumLevel, xpMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(TypeToken<?> type, SimpleRepairable obj, ConfigurationNode value) throws ObjectMappingException {
|
||||
public void serialize(TypeToken<?> type, Repairable obj, ConfigurationNode value) throws ObjectMappingException {
|
||||
|
||||
/*value.getNode("Item").setValue(HOCONUtil.serializeENUMName(obj.getItemMaterial().getKey().getKey()));
|
||||
value.getNode("Item-Used-To-Repair").setValue(HOCONUtil.serializeENUMName(obj.getRepairMaterials().getKey().getKey()));*/
|
||||
|
@ -3,7 +3,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 com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
import org.bukkit.Material;
|
||||
@ -16,58 +16,58 @@ import static org.bukkit.Material.*;
|
||||
@ConfigSerializable
|
||||
public class ConfigRepair {
|
||||
|
||||
public static final ArrayList<SimpleRepairable> CONFIG_REPAIRABLES_DEFAULTS;
|
||||
public static final ArrayList<Repairable> CONFIG_REPAIRABLES_DEFAULTS;
|
||||
public static final Material[] PLANKS = new Material[] { OAK_PLANKS, BIRCH_PLANKS, DARK_OAK_PLANKS, ACACIA_PLANKS, JUNGLE_PLANKS, SPRUCE_PLANKS};
|
||||
|
||||
static {
|
||||
CONFIG_REPAIRABLES_DEFAULTS = new ArrayList<>();
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_SWORD, Arrays.asList(PLANKS), 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_SHOVEL, Arrays.asList(PLANKS), 1, 0, .15D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_PICKAXE, Arrays.asList(PLANKS), 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_AXE, Arrays.asList(PLANKS), 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(WOODEN_HOE, Arrays.asList(PLANKS), 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_SWORD, Arrays.asList(PLANKS), 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_SHOVEL, Arrays.asList(PLANKS), 1, 0, .15D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_PICKAXE, Arrays.asList(PLANKS), 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_AXE, Arrays.asList(PLANKS), 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(WOODEN_HOE, Arrays.asList(PLANKS), 1, 0, .25D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(STONE_SWORD, COBBLESTONE, 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(STONE_SHOVEL, COBBLESTONE, 1, 0, .15D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(STONE_PICKAXE, COBBLESTONE, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(STONE_AXE, COBBLESTONE, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(STONE_HOE, COBBLESTONE, 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(STONE_SWORD, COBBLESTONE, 1, 0, .25D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(STONE_SHOVEL, COBBLESTONE, 1, 0, .15D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(STONE_PICKAXE, COBBLESTONE, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(STONE_AXE, COBBLESTONE, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(STONE_HOE, COBBLESTONE, 1, 0, .25D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_SWORD, IRON_INGOT, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_SHOVEL, IRON_INGOT, 1, 0, .3D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_PICKAXE, IRON_INGOT, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_AXE, IRON_INGOT, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_HOE, IRON_INGOT, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_SWORD, IRON_INGOT, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_SHOVEL, IRON_INGOT, 1, 0, .3D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_PICKAXE, IRON_INGOT, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_AXE, IRON_INGOT, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_HOE, IRON_INGOT, 1, 0, .5D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_HELMET, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_CHESTPLATE, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_LEGGINGS, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(IRON_BOOTS, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_HELMET, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_CHESTPLATE, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_LEGGINGS, IRON_INGOT, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(IRON_BOOTS, IRON_INGOT, 1, 0, 2D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(SHEARS, IRON_INGOT, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(FLINT_AND_STEEL, IRON_INGOT, 1, 0, .3D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(SHEARS, IRON_INGOT, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(FLINT_AND_STEEL, IRON_INGOT, 1, 0, .3D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_SWORD, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_SHOVEL, GOLD_INGOT, 1, 0, 2.6D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_PICKAXE, GOLD_INGOT, 1, 0, 8D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_AXE, GOLD_INGOT, 1, 0, 8D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_HOE, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_SWORD, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_SHOVEL, GOLD_INGOT, 1, 0, 2.6D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_PICKAXE, GOLD_INGOT, 1, 0, 8D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_AXE, GOLD_INGOT, 1, 0, 8D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_HOE, GOLD_INGOT, 1, 0, 4D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_HELMET, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_CHESTPLATE, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_LEGGINGS, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(GOLDEN_BOOTS, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_HELMET, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_CHESTPLATE, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_LEGGINGS, GOLD_INGOT, 1, 0, 4D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(GOLDEN_BOOTS, GOLD_INGOT, 1, 0, 4D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_SWORD, DIAMOND, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_SHOVEL, DIAMOND, 1, 0, .3D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_PICKAXE, DIAMOND, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_AXE, DIAMOND, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_HOE, DIAMOND, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_SWORD, DIAMOND, 1, 0, .5D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_SHOVEL, DIAMOND, 1, 0, .3D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_PICKAXE, DIAMOND, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_AXE, DIAMOND, 1, 0, 1D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_HOE, DIAMOND, 1, 0, .5D));
|
||||
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_HELMET, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_CHESTPLATE, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_LEGGINGS, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new SimpleRepairable(DIAMOND_BOOTS, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_HELMET, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_CHESTPLATE, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_LEGGINGS, DIAMOND, 1, 0, 2D));
|
||||
CONFIG_REPAIRABLES_DEFAULTS.add(new Repairable(DIAMOND_BOOTS, DIAMOND, 1, 0, 2D));
|
||||
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class ConfigRepair {
|
||||
"\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;
|
||||
private ArrayList<Repairable> configRepairablesList = CONFIG_REPAIRABLES_DEFAULTS;
|
||||
|
||||
public ConfigRepairGeneral getRepairGeneral() {
|
||||
return repairGeneral;
|
||||
@ -109,7 +109,7 @@ public class ConfigRepair {
|
||||
return repairSubSkills.getArcaneForging();
|
||||
}
|
||||
|
||||
public ArrayList<SimpleRepairable> getConfigRepairablesList() {
|
||||
public ArrayList<Repairable> getConfigRepairablesList() {
|
||||
return configRepairablesList;
|
||||
}
|
||||
}
|
@ -1,12 +1,242 @@
|
||||
package com.gmail.nossr50.config.hocon.skills.salvage;
|
||||
|
||||
import com.gmail.nossr50.config.hocon.skills.salvage.general.ConfigSalvageGeneral;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigSalvage {
|
||||
|
||||
private final static List<Salvageable> DEFAULT_SALVAGEABLES_LIST;
|
||||
|
||||
static {
|
||||
DEFAULT_SALVAGEABLES_LIST = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Salvageables:
|
||||
#
|
||||
# Wooden salvageables
|
||||
###
|
||||
# Tools
|
||||
WOODEN_SWORD:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .25
|
||||
MaximumQuantity: 2
|
||||
WOODEN_SHOVEL:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .16
|
||||
MaximumQuantity: 1
|
||||
WOODEN_PICKAXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 3
|
||||
WOODEN_AXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
WOODEN_HOE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .25
|
||||
MaximumQuantity: 2
|
||||
#
|
||||
# Stone salvageables
|
||||
###
|
||||
# Tools
|
||||
STONE_SWORD:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .25
|
||||
MaximumQuantity: 2
|
||||
STONE_SHOVEL:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .16
|
||||
MaximumQuantity: 1
|
||||
STONE_PICKAXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 3
|
||||
STONE_AXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
STONE_HOE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .25
|
||||
MaximumQuantity: 2
|
||||
#
|
||||
# Iron salvageables
|
||||
###
|
||||
# Tools
|
||||
IRON_SWORD:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
IRON_SHOVEL:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .3
|
||||
MaximumQuantity: 1
|
||||
IRON_PICKAXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 3
|
||||
IRON_AXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 2
|
||||
IRON_HOE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
SHEARS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
FLINT_AND_STEEL:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .3
|
||||
# Armor
|
||||
IRON_HELMET:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 2
|
||||
MaximumQuantity: 5
|
||||
IRON_CHESTPLATE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 2
|
||||
MaximumQuantity: 8
|
||||
IRON_LEGGINGS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 2
|
||||
MaximumQuantity: 7
|
||||
IRON_BOOTS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 2
|
||||
MaximumQuantity: 4
|
||||
#
|
||||
# Gold salvageables
|
||||
###
|
||||
# Tools
|
||||
GOLDEN_SWORD:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 2
|
||||
GOLDEN_SHOVEL:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 2.6
|
||||
MaximumQuantity: 1
|
||||
GOLDEN_PICKAXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 8
|
||||
MaximumQuantity: 3
|
||||
GOLDEN_AXE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 8
|
||||
MaximumQuantity: 2
|
||||
GOLDEN_HOE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 2
|
||||
# Armor
|
||||
GOLDEN_HELMET:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 5
|
||||
GOLDEN_CHESTPLATE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 8
|
||||
GOLDEN_LEGGINGS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 7
|
||||
GOLDEN_BOOTS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 4
|
||||
MaximumQuantity: 4
|
||||
#
|
||||
# Diamond salvageables
|
||||
###
|
||||
# Tools
|
||||
DIAMOND_SWORD:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
DIAMOND_SHOVEL:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: .3
|
||||
MaximumQuantity: 1
|
||||
DIAMOND_PICKAXE:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 3
|
||||
DIAMOND_AXE:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 2
|
||||
DIAMOND_HOE:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: .5
|
||||
MaximumQuantity: 2
|
||||
# Armor
|
||||
DIAMOND_HELMET:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 6
|
||||
MaximumQuantity: 5
|
||||
DIAMOND_CHESTPLATE:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 6
|
||||
MaximumQuantity: 8
|
||||
DIAMOND_LEGGINGS:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 6
|
||||
MaximumQuantity: 7
|
||||
DIAMOND_BOOTS:
|
||||
MinimumLevel: 50
|
||||
XpMultiplier: 6
|
||||
MaximumQuantity: 4
|
||||
#
|
||||
# Leather salvageables
|
||||
###
|
||||
# Armor
|
||||
LEATHER_HELMET:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 5
|
||||
LEATHER_CHESTPLATE:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 8
|
||||
LEATHER_LEGGINGS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 7
|
||||
LEATHER_BOOTS:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: 1
|
||||
MaximumQuantity: 4
|
||||
#
|
||||
# String salvageables
|
||||
###
|
||||
# Tools
|
||||
FISHING_ROD:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
BOW:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
CARROT_ON_A_STICK:
|
||||
MinimumLevel: 0
|
||||
XpMultiplier: .5
|
||||
*/
|
||||
}
|
||||
|
||||
@Setting()
|
||||
List<Salvageable> configSalvageablesList;
|
||||
|
||||
|
||||
@Setting(value = "Arcane-Salvage", comment = "Settings related to the Arcane Salvage Sub-Skill")
|
||||
ConfigArcaneSalvage configArcaneSalvage = new ConfigArcaneSalvage();
|
||||
|
||||
@ -20,4 +250,8 @@ public class ConfigSalvage {
|
||||
public ConfigSalvageGeneral getGeneral() {
|
||||
return general;
|
||||
}
|
||||
|
||||
public ArrayList<Salvageable> getConfigSalvageablesList() {
|
||||
return configSalvageablesList;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user