Repair Config Pt 4, Salvage Config pt 1

This commit is contained in:
nossr50 2019-03-21 22:55:59 -07:00
parent ef6bec4ffc
commit 68b32e0b9e
4 changed files with 146 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}