9
0
mirror of https://github.com/Auxilor/Reforges.git synced 2026-01-06 15:51:32 +00:00

Switched from json to yml

This commit is contained in:
Auxilor
2021-12-04 15:59:13 +00:00
parent 5b2d0c9b52
commit 92f964c5af
6 changed files with 397 additions and 604 deletions

View File

@@ -9,7 +9,7 @@ import com.willfp.libreforge.LibReforge;
import com.willfp.libreforge.effects.ConfiguredEffect;
import com.willfp.reforges.commands.CommandReforge;
import com.willfp.reforges.commands.CommandReforges;
import com.willfp.reforges.config.ReforgesJson;
import com.willfp.reforges.config.ReforgesYml;
import com.willfp.reforges.config.TargetYml;
import com.willfp.reforges.display.ReforgesDisplay;
import com.willfp.reforges.integrations.talismans.TalismansIntegration;
@@ -43,10 +43,10 @@ public class ReforgesPlugin extends EcoPlugin {
private final TargetYml targetYml;
/**
* reforges.json.
* reforges.yml.
*/
@Getter
private final ReforgesJson reforgesJson;
private final ReforgesYml reforgesYml;
/**
* Internal constructor called by bukkit on plugin load.
@@ -55,7 +55,7 @@ public class ReforgesPlugin extends EcoPlugin {
super(1330, 12412, "&3", true);
LibReforge.init(this);
this.targetYml = new TargetYml(this);
this.reforgesJson = new ReforgesJson(this);
this.reforgesYml = new ReforgesYml(this);
instance = this;
LibReforge.registerHolderProvider(ReforgeLookup::provideReforges);

View File

@@ -1,16 +1,16 @@
package com.willfp.reforges.config;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.config.json.JSONBaseConfig;
import com.willfp.eco.core.config.yaml.YamlBaseConfig;
import org.jetbrains.annotations.NotNull;
public class ReforgesJson extends JSONBaseConfig {
public class ReforgesYml extends YamlBaseConfig {
/**
* Instantiate reforges.json.
* Instantiate reforges.yml.
*
* @param plugin Instance of reforges.
*/
public ReforgesJson(@NotNull final EcoPlugin plugin) {
public ReforgesYml(@NotNull final EcoPlugin plugin) {
super("reforges", true, plugin);
}
}

View File

@@ -3,7 +3,7 @@ package com.willfp.reforges.reforges;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ImmutableSet;
import com.willfp.eco.core.config.interfaces.JSONConfig;
import com.willfp.eco.core.config.interfaces.Config;
import com.willfp.eco.core.config.updating.ConfigUpdater;
import com.willfp.reforges.ReforgesPlugin;
import lombok.experimental.UtilityClass;
@@ -59,7 +59,7 @@ public class Reforges {
removeReforge(reforge);
}
for (JSONConfig config : plugin.getReforgesJson().getSubsections("reforges")) {
for (Config config : plugin.getReforgesYml().getSubsections("reforges")) {
new Reforge(config, plugin);
}
}

View File

@@ -1,6 +1,6 @@
package com.willfp.reforges.reforges
import com.willfp.eco.core.config.interfaces.JSONConfig
import com.willfp.eco.core.config.interfaces.Config
import com.willfp.eco.core.display.Display
import com.willfp.eco.core.items.CustomItem
import com.willfp.eco.core.items.Items
@@ -17,7 +17,7 @@ import java.util.*
@Suppress("DEPRECATION")
class Reforge(
internal val config: JSONConfig,
internal val config: Config,
plugin: ReforgesPlugin
) : Holder {
val id = config.getString("id")

View File

@@ -1,592 +0,0 @@
{
"reforges": [
{
"id": "acute",
"name": "<gradient:#4776E6>Acute</gradient:#8E54E9>",
"description": [
"&a+2% &fTriple Damage Chance"
],
"targets": [
"axe"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 3,
"chance": 2
},
"triggers": [
"melee_attack"
]
}
],
"conditions": []
},
{
"id": "aerobic",
"name": "<gradient:#B993D6>Aerobic</gradient:#8CA6DB>",
"description": [
"&a+9% &fDamage when shot in air"
],
"targets": [
"bow"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.09
},
"triggers": [
"bow_attack"
]
}
],
"conditions": [
{
"id": "in_air",
"args": {
"in_air": true
}
}
]
},
{
"id": "dynamic",
"name": "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>",
"description": [
"&a+5% &fDamage",
"&a+10% &fCrit Damage"
],
"targets": [
"melee"
],
"stone": {
"enabled": true,
"name": "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&f Reforge Stone",
"lore": [
"&7Place on the right of the",
"&7reforge menu to apply the",
"<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&7 reforge!"
],
"item": "player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM0YTY1YzY4OWIyZDM2NDA5MTAwYTYwYzJhYjhkM2QwYTY3Y2U5NGVlYTNjMWY3YWM5NzRmZDg5MzU2OGI1ZCJ9fX0=",
"craftable": true,
"recipe": [
"air",
"ecoitems:blank_reforge_stone ? air",
"air",
"iron_block",
"daylight_sensor",
"iron_block",
"air",
"phantom_membrane",
"air"
]
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.05
},
"triggers": [
"melee_attack"
]
},
{
"id": "crit_multiplier",
"args": {
"multiplier": 1.1
},
"triggers": [
"melee_attack"
]
}
],
"conditions": [
]
},
{
"id": "evasive",
"name": "<gradient:#EFEFBB>Evasive</gradient:#D4D3DD>",
"description": [
"&a+2% &fIgnore Damage Chance"
],
"targets": [
"armor"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 0,
"chance": 2
},
"triggers": [
"take_damage"
]
}
],
"conditions": [
]
},
{
"id": "gravitated",
"name": "<gradient:#1e3c72>Gravitated</gradient:#2a5298>",
"description": [
"&a+8% &fCritical Damage"
],
"targets": [
"melee"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "crit_multiplier",
"args": {
"multiplier": 1.08
},
"triggers": [
"melee_attack"
]
}
],
"conditions": [
]
},
{
"id": "light",
"name": "<gradient:#1c92d2>Light</gradient:#f2fcfe>",
"description": [
"&c-5% &fDamage",
"&c-5% &fKnockback",
"&a+10% &fAttack Speed"
],
"targets": [
"melee"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 0.95
},
"triggers": [
"melee_attack"
]
},
{
"id": "knockback_multiplier",
"args": {
"multiplier": 0.95
}
},
{
"id": "attack_speed_multiplier",
"args": {
"multiplier": 1.1
}
}
],
"conditions": [
]
},
{
"id": "nautical",
"name": "<gradient:#373B44>Nautical</gradient:#4286f4>",
"description": [
"&a+20% &fDamage in water"
],
"targets": [
"melee",
"bow",
"trident"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.2
},
"triggers": [
"melee_attack",
"bow_attack",
"trident_attack"
]
}
],
"conditions": [
{
"id": "in_water",
"args": {
"in_water": true
}
}
]
},
{
"id": "pointy",
"name": "<gradient:#076585>Pointy</gradient:#ffffff>",
"description": [
"&a+10% &fDamage"
],
"targets": [
"trident"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.1
},
"triggers": [
"trident_attack"
]
}
],
"conditions": [
]
},
{
"id": "prospecting",
"name": "<gradient:#00B4DB>Prospecting</gradient:#0083B0>",
"description": [
"&a+5% &fChance to get &e\u00242&f for mining a block"
],
"targets": [
"pickaxe"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "give_money",
"args": {
"amount": 2,
"chance": 5
},
"triggers": [
"mine_block"
]
}
],
"conditions": [
]
},
{
"id": "reinforced",
"name": "<gradient:#FBD786>Reinforced</gradient:#f7797d>",
"description": [
"&a+4% &fDamage Resistance"
],
"targets": [
"armor"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 0.96
},
"triggers": [
"take_damage"
]
}
],
"conditions": [
]
},
{
"id": "rich",
"name": "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>",
"description": [
"&a+\u002450 &fFor each mob kill"
],
"targets": [
"trident",
"bow"
],
"stone": {
"enabled": true,
"name": "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&f Reforge Stone",
"lore": [
"&7Place on the right of the",
"&7reforge menu to apply the",
"<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&7 reforge!"
],
"item": "player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2RjNTdjNzVhZGYzOWVjNmYwZTA5MTYwNDlkZDk2NzFlOThhOGExZTYwMDEwNGU4NGU2NDVjOTg4OTUwYmQ3In19fQ==",
"craftable": true,
"recipe": [
"gold_block",
"trident",
"gold_block",
"air",
"ecoitems:blank_reforge_stone ? obsidian",
"air",
"gold_block",
"bow",
"gold_block"
]
},
"effects": [
{
"id": "give_money",
"args": {
"amount": 50
},
"triggers": [
"kill"
]
}
],
"conditions": [
]
},
{
"id": "sharp",
"name": "<gradient:#f12711>Sharp</gradient:#f5af19>",
"description": [
"&a+3% &fDamage"
],
"targets": [
"melee"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.03
},
"triggers": [
"melee_attack"
]
}
],
"conditions": [
]
},
{
"id": "streamlined",
"name": "<gradient:#74ebd5>Streamlined</gradient:#ACB6E5>",
"description": [
"&a+4% &fDamage"
],
"targets": [
"bow"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.04
},
"triggers": [
"bow_attack"
]
}
],
"conditions": [
]
},
{
"id": "strong",
"name": "<gradient:#ED213A>Strong</gradient:#93291E>",
"description": [
"&a+2% &fDamage",
"&a+10% &fKnockback"
],
"targets": [
"melee"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.02
},
"triggers": [
"melee_attack"
]
},
{
"id": "knockback_multiplier",
"args": {
"multiplier": 1.1
}
}
],
"conditions": [
]
},
{
"id": "thin",
"name": "<gradient:#D1913C>Thin</gradient:#FFD194>",
"description": [
"&c-5% &fDamage Resistance",
"&a+2.5% &fMovement Speed"
],
"targets": [
"armor"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 1.05
},
"triggers": [
"take_damage"
]
},
{
"id": "movement_speed_multiplier",
"args": {
"multiplier": 1.025
}
}
],
"conditions": [
]
},
{
"id": "tough",
"name": "<gradient:#a73737>Tough</gradient:#7a2828>",
"description": [
"&c+8% &fDamage Resistance",
"&a-5% &fMovement Speed"
],
"targets": [
"armor"
],
"stone": {
"enabled": false,
"name": "",
"lore": [],
"item": "",
"craftable": false,
"recipe": []
},
"effects": [
{
"id": "damage_multiplier",
"args": {
"multiplier": 0.92
},
"triggers": [
"take_damage"
]
},
{
"id": "movement_speed_multiplier",
"args": {
"multiplier": 0.95
}
}
],
"conditions": [
]
}
]
}

View File

@@ -0,0 +1,385 @@
reforges:
- id: acute
name: "<gradient:#4776E6>Acute</gradient:#8E54E9>"
description:
- "&a+2% &fTriple Damage Chance"
targets:
- axe
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 3
chance: 2
triggers:
- melee_attack
conditions: []
- id: aerobic
name: "<gradient:#B993D6>Aerobic</gradient:#8CA6DB>"
description:
- "&a+9% &fDamage when shot in air"
targets:
- bow
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.09
triggers:
- bow_attack
conditions:
- id: in_air
args:
in_air: true
- id: dynamic
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>"
description:
- "&a+5% &fDamage"
- "&a+10% &fCrit Damage"
targets:
- melee
stone:
enabled: true
name: "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&f Reforge Stone"
lore:
- "&7Place on the right of the"
- "&7reforge menu to apply the"
- "<gradient:#AAFFA9>Dynamic</gradient:#11FFBD>&7 reforge!"
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM0YTY1YzY4OWIyZDM2NDA5MTAwYTYwYzJhYjhkM2QwYTY3Y2U5NGVlYTNjMWY3YWM5NzRmZDg5MzU2OGI1ZCJ9fX0=
craftable: true
recipe:
- air
- ecoitems:blank_reforge_stone ? air
- air
- iron_block
- daylight_sensor
- iron_block
- air
- phantom_membrane
- air
effects:
- id: damage_multiplier
args:
multiplier: 1.05
triggers:
- melee_attack
- id: crit_multiplier
args:
multiplier: 1.1
triggers:
- melee_attack
conditions: []
- id: evasive
name: "<gradient:#EFEFBB>Evasive</gradient:#D4D3DD>"
description:
- "&a+2% &fIgnore Damage Chance"
targets:
- armor
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 0
chance: 2
triggers:
- take_damage
conditions: []
- id: gravitated
name: "<gradient:#1e3c72>Gravitated</gradient:#2a5298>"
description:
- "&a+8% &fCritical Damage"
targets:
- melee
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: crit_multiplier
args:
multiplier: 1.08
triggers:
- melee_attack
conditions: []
- id: light
name: "<gradient:#1c92d2>Light</gradient:#f2fcfe>"
description:
- "&c-5% &fDamage"
- "&c-5% &fKnockback"
- "&a+10% &fAttack Speed"
targets:
- melee
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 0.95
triggers:
- melee_attack
- id: knockback_multiplier
args:
multiplier: 0.95
- id: attack_speed_multiplier
args:
multiplier: 1.1
conditions: []
- id: nautical
name: "<gradient:#373B44>Nautical</gradient:#4286f4>"
description:
- "&a+20% &fDamage in water"
targets:
- melee
- bow
- trident
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.2
triggers:
- melee_attack
- bow_attack
- trident_attack
conditions:
- id: in_water
args:
in_water: true
- id: pointy
name: "<gradient:#076585>Pointy</gradient:#ffffff>"
description:
- "&a+10% &fDamage"
targets:
- trident
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.1
triggers:
- trident_attack
conditions: []
- id: prospecting
name: "<gradient:#00B4DB>Prospecting</gradient:#0083B0>"
description:
- "&a+5% &fChance to get &e$2&f for mining a block"
targets:
- pickaxe
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: give_money
args:
amount: 2
chance: 5
triggers:
- mine_block
conditions: []
- id: reinforced
name: "<gradient:#FBD786>Reinforced</gradient:#f7797d>"
description:
- "&a+4% &fDamage Resistance"
targets:
- armor
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 0.96
triggers:
- take_damage
conditions: []
- id: rich
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>"
description:
- "&a+$50 &fFor each mob kill"
targets:
- trident
- bow
stone:
enabled: true
name: "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&f Reforge Stone"
lore:
- "&7Place on the right of the"
- "&7reforge menu to apply the"
- "<gradient:#DBDBDB>Rich</gradient:#F2F2F2>&7 reforge!"
item: player_head texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2RjNTdjNzVhZGYzOWVjNmYwZTA5MTYwNDlkZDk2NzFlOThhOGExZTYwMDEwNGU4NGU2NDVjOTg4OTUwYmQ3In19fQ==
craftable: true
recipe:
- gold_block
- trident
- gold_block
- air
- ecoitems:blank_reforge_stone ? obsidian
- air
- gold_block
- bow
- gold_block
effects:
- id: give_money
args:
amount: 50
triggers:
- kill
conditions: []
- id: sharp
name: "<gradient:#f12711>Sharp</gradient:#f5af19>"
description:
- "&a+3% &fDamage"
targets:
- melee
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.03
triggers:
- melee_attack
conditions: []
- id: streamlined
name: "<gradient:#74ebd5>Streamlined</gradient:#ACB6E5>"
description:
- "&a+4% &fDamage"
targets:
- bow
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.04
triggers:
- bow_attack
conditions: []
- id: strong
name: "<gradient:#ED213A>Strong</gradient:#93291E>"
description:
- "&a+2% &fDamage"
- "&a+10% &fKnockback"
targets:
- melee
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.02
triggers:
- melee_attack
- id: knockback_multiplier
args:
multiplier: 1.1
conditions: []
- id: thin
name: "<gradient:#D1913C>Thin</gradient:#FFD194>"
description:
- "&c-5% &fDamage Resistance"
- "&a+2.5% &fMovement Speed"
targets:
- armor
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 1.05
triggers:
- take_damage
- id: movement_speed_multiplier
args:
multiplier: 1.025
conditions: []
- id: tough
name: "<gradient:#a73737>Tough</gradient:#7a2828>"
description:
- "&c+8% &fDamage Resistance"
- "&a-5% &fMovement Speed"
targets:
- armor
stone:
enabled: false
name: ''
lore: []
item: ''
craftable: false
recipe: []
effects:
- id: damage_multiplier
args:
multiplier: 0.92
triggers:
- take_damage
- id: movement_speed_multiplier
args:
multiplier: 0.95
conditions: []