!Update default configs

This commit is contained in:
Indyuce 2020-04-07 17:34:45 +02:00
parent c76d464273
commit afad5abca0
4 changed files with 43 additions and 2 deletions

View File

@ -57,7 +57,8 @@ public class ConfigManager {
dynamicFolder.mkdir();
if (!new File(MMOItems.plugin.getDataFolder() + "/generator").exists()) {
new File(MMOItems.plugin.getDataFolder() + "/generator/items").mkdir();
new File(MMOItems.plugin.getDataFolder() + "/generator").mkdir();
new File(MMOItems.plugin.getDataFolder() + "/generator/templates").mkdir();
new File(MMOItems.plugin.getDataFolder() + "/generator/modifiers").mkdir();
}
@ -272,6 +273,10 @@ public class ConfigManager {
LORE_FORMAT("lore-format.yml", "language", "lore-format.yml"),
STATS("stats.yml", "language", "stats.yml"),
// item generator
EXAMPLE_GEN_TEMPLATES("generator/templates/example-templates.yml", "generator/templates", "example-templates.yml"),
EXAMPLE_GEN_MODIFIERS("generator/modifiers/example-modifiers.yml", "generator/modifiers", "example-modifiers.yml"),
// default item config files -> /MMOItems/item
ARMOR("item/armor.yml", "item", "armor.yml"),
AXE("item/axe.yml", "item", "axe.yml"),

View File

@ -33,7 +33,7 @@ public class ItemGenManager {
public void reload() {
templates.clear();
for (File file : new File(MMOItems.plugin.getDataFolder() + "/generator/items").listFiles()) {
for (File file : new File(MMOItems.plugin.getDataFolder() + "/generator/templates").listFiles()) {
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
for (String key : config.getKeys(false))
try {

View File

@ -0,0 +1,34 @@
# Example item
LONG_SWORD:
# Basic item information
type: SWORD
material: IRON_SWORD
# The more weight a randomly generated item has,
# the more modifiers it will be able to roll
weight:
base: 3
scale: 1
relative-spread: .1
max-relative-spread: .3
# Base item data
base:
name: '&fLong Sword'
max-durability: 300.0
attack-damage: 7
# Modifiers which have a chance to be rolled
modifiers:
sharp:
chance: 0.3
prefix:
format: '&fSharp'
priority : 0
stats:
attack-damage: 3
lore:
- '&7Much sharper!'