From 68b32e0b9ee31dc61486900936d0cf805bfcc1bb Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 21 Mar 2019 22:55:59 -0700 Subject: [PATCH] Repair Config Pt 4, Salvage Config pt 1 --- .../hocon/skills/repair/ConfigRepair.java | 8 +++ .../repair/general/ConfigRepairGeneral.java | 70 +++++++++++++++++++ .../hocon/skills/salvage/ConfigSalvage.java | 15 ++++ .../salvage/general/ConfigSalvageGeneral.java | 53 ++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/repair/general/ConfigRepairGeneral.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepair.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepair.java index 6475ec0da..416a8acea 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepair.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/ConfigRepair.java @@ -1,5 +1,6 @@ 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 ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @@ -16,6 +17,13 @@ public class ConfigRepair { @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(); + + public ConfigRepairGeneral getRepairGeneral() { + return repairGeneral; + } + public ConfigRepairMastery getRepairMastery() { return repairMastery; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/general/ConfigRepairGeneral.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/general/ConfigRepairGeneral.java new file mode 100644 index 000000000..cf5ab8180 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/repair/general/ConfigRepairGeneral.java @@ -0,0 +1,70 @@ +package com.gmail.nossr50.config.hocon.skills.repair.general; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; +import org.bukkit.Material; + +@ConfigSerializable +public class ConfigRepairGeneral { + public static final boolean ANVIL_USE_SOUNDS_DEFAULT = true; + public static final boolean ANVIL_MESSAGES_DEFAULT = true; + public static final boolean ANVIL_PLACED_SOUNDS_DEFAULT = true; + public static final boolean ENCHANTED_ITEMS_REQUIRE_CONFIRM = true; + + /* + public Material getRepairAnvilMaterial() { + //Iron block + return Material.matchMaterial(getStringValue(SKILLS, REPAIR, ANVIL_MATERIAL)); + } + + public boolean getRepairConfirmRequired() { + return getBooleanValue(SKILLS, REPAIR, CONFIRM_REQUIRED); + } + + public boolean getRepairAnvilMessagesEnabled() { + return getBooleanValue(SKILLS, REPAIR, ANVIL + MESSAGES); + } + */ + + + @Setting(value = "Anvil-Block-Material", comment = "The block used for mcMMO repairs." + + "Default value: "+"IRON_BLOCK") + private Material repairAnvilMaterial = Material.IRON_BLOCK; + + @Setting(value = "Anvil-Use-Sounds", comment = "If true, mcMMO will play a sound when a player uses an anvil." + + "\nDefault value: "+ANVIL_USE_SOUNDS_DEFAULT) + private boolean anvilUseSounds = ANVIL_USE_SOUNDS_DEFAULT; + + @Setting(value = "Anvil-Notifications", comment = "Allows helpful messages to help players understand how to use the anvil." + + "\nDefault value: "+ANVIL_MESSAGES_DEFAULT) + private boolean anvilMessages = ANVIL_MESSAGES_DEFAULT; + + @Setting(value = "Anvil-Placed-Sounds", comment = "Placing an anvil in the world will play a sound effect." + + "\nDefault value: "+ANVIL_PLACED_SOUNDS_DEFAULT) + private boolean anvilPlacedSounds = ANVIL_PLACED_SOUNDS_DEFAULT; + + @Setting(value = "Enchanted-Items-Require-Confirm", comment = "Warns players that using the anvil with an enchanted item is dangerous." + + "\nPlayers will have to use the anvil twice in a row with an enchanted item." + + "\nDefault value: "+ENCHANTED_ITEMS_REQUIRE_CONFIRM) + private boolean enchantedItemsRequireConfirm = ENCHANTED_ITEMS_REQUIRE_CONFIRM; + + public Material getRepairAnvilMaterial() { + return repairAnvilMaterial; + } + + public boolean isAnvilUseSounds() { + return anvilUseSounds; + } + + public boolean isAnvilMessages() { + return anvilMessages; + } + + public boolean isAnvilPlacedSounds() { + return anvilPlacedSounds; + } + + public boolean isEnchantedItemsRequireConfirm() { + return enchantedItemsRequireConfirm; + } +} \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/ConfigSalvage.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/ConfigSalvage.java index 00602c719..7e60a1938 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/ConfigSalvage.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/ConfigSalvage.java @@ -1,8 +1,23 @@ package com.gmail.nossr50.config.hocon.skills.salvage; +import com.gmail.nossr50.config.hocon.skills.salvage.general.ConfigSalvageGeneral; +import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigSalvage { + @Setting(value = "Arcane-Salvage", comment = "Settings related to the Arcane Salvage Sub-Skill") + ConfigArcaneSalvage configArcaneSalvage = new ConfigArcaneSalvage(); + + @Setting(value = "General") + ConfigSalvageGeneral general = new ConfigSalvageGeneral(); + + public ConfigArcaneSalvage getConfigArcaneSalvage() { + return configArcaneSalvage; + } + + public ConfigSalvageGeneral getGeneral() { + return general; + } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java new file mode 100644 index 000000000..b54d5db3d --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java @@ -0,0 +1,53 @@ +package com.gmail.nossr50.config.hocon.skills.salvage.general; + +import ninja.leaping.configurate.objectmapping.Setting; +import org.bukkit.Material; + +public class ConfigSalvageGeneral { + + public static final boolean ANVIL_USE_SOUNDS_DEFAULT = true; + public static final boolean ANVIL_MESSAGES_DEFAULT = true; + public static final boolean ANVIL_PLACED_SOUNDS_DEFAULT = true; + public static final boolean ENCHANTED_ITEMS_REQUIRE_CONFIRM = true; + + @Setting(value = "Anvil-Block-Material", comment = "The block used for mcMMO repairs." + + "Default value: "+"IRON_BLOCK") + private Material salvageAnvilMaterial = Material.GOLD_BLOCK; + + @Setting(value = "Anvil-Use-Sounds", comment = "If true, mcMMO will play a sound when a player uses an anvil." + + "\nDefault value: "+ANVIL_USE_SOUNDS_DEFAULT) + private boolean anvilUseSounds = ANVIL_USE_SOUNDS_DEFAULT; + + @Setting(value = "Anvil-Notifications", comment = "Allows helpful messages to help players understand how to use the anvil." + + "\nDefault value: "+ANVIL_MESSAGES_DEFAULT) + private boolean anvilMessages = ANVIL_MESSAGES_DEFAULT; + + @Setting(value = "Anvil-Placed-Sounds", comment = "Placing an anvil in the world will play a sound effect." + + "\nDefault value: "+ANVIL_PLACED_SOUNDS_DEFAULT) + private boolean anvilPlacedSounds = ANVIL_PLACED_SOUNDS_DEFAULT; + + @Setting(value = "Enchanted-Items-Require-Confirm", comment = "Warns players that using the anvil with an enchanted item is dangerous." + + "\nPlayers will have to use the anvil twice in a row with an enchanted item." + + "\nDefault value: "+ENCHANTED_ITEMS_REQUIRE_CONFIRM) + private boolean enchantedItemsRequireConfirm = ENCHANTED_ITEMS_REQUIRE_CONFIRM; + + public Material getSalvageAnvilMaterial() { + return salvageAnvilMaterial; + } + + public boolean isAnvilUseSounds() { + return anvilUseSounds; + } + + public boolean isAnvilMessages() { + return anvilMessages; + } + + public boolean isAnvilPlacedSounds() { + return anvilPlacedSounds; + } + + public boolean isEnchantedItemsRequireConfirm() { + return enchantedItemsRequireConfirm; + } +}