More move advancements to data gen

This commit is contained in:
modmuss50 2023-05-13 23:49:22 +01:00 committed by modmuss
parent 9c3ef46665
commit 4c131a1574
27 changed files with 211 additions and 687 deletions

View file

@ -39,6 +39,7 @@ class AdvancementFactory {
private List<CriterionConditions> conditionsList = [] private List<CriterionConditions> conditionsList = []
private Advancement parent private Advancement parent
private Identifier background private Identifier background
private boolean hidden = false
void name(String name) { void name(String name) {
this.name = name this.name = name
@ -68,6 +69,10 @@ class AdvancementFactory {
this.background = identifier this.background = identifier
} }
void hidden(boolean hidden) {
this.hidden = hidden
}
Advancement build() { Advancement build() {
Objects.requireNonNull(name, "No name set") Objects.requireNonNull(name, "No name set")
assert conditionsList.size() > 0 assert conditionsList.size() > 0
@ -82,7 +87,7 @@ class AdvancementFactory {
frame, frame,
true, true,
true, true,
false hidden
) )
int i = 0 int i = 0

View file

@ -64,6 +64,7 @@ class TRAdvancementProvider extends FabricAdvancementProvider {
} }
refinedIronTree(root) refinedIronTree(root)
treeTapTree(root)
} }
private void refinedIronTree(Advancement root) { private void refinedIronTree(Advancement root) {
@ -88,6 +89,22 @@ class TRAdvancementProvider extends FabricAdvancementProvider {
condition inventoryChanged(TRContent.MachineBlocks.BASIC.frame) condition inventoryChanged(TRContent.MachineBlocks.BASIC.frame)
} }
machineTree(machineBlock)
def ironAlloyFurnace = create {
parent machineBlock
name "ironalloyfurnace"
icon TRContent.Machine.IRON_ALLOY_FURNACE
condition inventoryChanged(TRContent.Machine.IRON_ALLOY_FURNACE.block)
}
def alloySmelter = create {
parent ironAlloyFurnace
name "alloysmelter"
icon TRContent.Machine.ALLOY_SMELTER
condition inventoryChanged(TRContent.Machine.ALLOY_SMELTER.block)
}
def generator = create { def generator = create {
parent machineBlock parent machineBlock
name "generator" name "generator"
@ -102,6 +119,194 @@ class TRAdvancementProvider extends FabricAdvancementProvider {
icon TRContent.Machine.WIND_MILL icon TRContent.Machine.WIND_MILL
condition placedBlock(TRContent.Machine.WIND_MILL.block) condition placedBlock(TRContent.Machine.WIND_MILL.block)
} }
solarTree(generator)
}
private void solarTree(Advancement root) {
def basicSolar = create {
parent root
name "basicsolar"
icon TRContent.SolarPanels.BASIC
condition placedBlock(TRContent.SolarPanels.BASIC.block)
}
def advancedSolar = create {
parent basicSolar
name "advancedsolar"
icon TRContent.SolarPanels.ADVANCED
condition placedBlock(TRContent.SolarPanels.ADVANCED.block)
}
def industrialSolar = create {
parent advancedSolar
name "industrialsolar"
icon TRContent.SolarPanels.INDUSTRIAL
frame AdvancementFrame.GOAL
condition placedBlock(TRContent.SolarPanels.INDUSTRIAL.block)
}
def ultimateSolar = create {
parent industrialSolar
name "ultimatesolar"
icon TRContent.SolarPanels.ULTIMATE
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.SolarPanels.ULTIMATE.block)
}
def quantumSolar = create {
parent industrialSolar
name "quantumsolar"
icon TRContent.SolarPanels.QUANTUM
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.SolarPanels.QUANTUM.block)
}
}
private void treeTapTree(Advancement root) {
def treeTap = create {
parent root
name "treetap"
icon TRContent.TREE_TAP
condition inventoryChanged(TRContent.TREE_TAP)
}
def sap = create {
parent treeTap
name "sap"
icon TRContent.Parts.SAP
condition inventoryChanged(TRContent.Parts.SAP)
}
def rubber = create {
parent sap
name "rubber"
icon TRContent.Parts.RUBBER
condition inventoryChanged(TRContent.Parts.RUBBER)
}
def copperCable = create {
parent rubber
name "coppercable"
icon TRContent.Cables.COPPER
condition inventoryChanged(TRContent.Cables.COPPER)
}
def upgrade = create {
parent copperCable
name "upgrade"
icon TRContent.Upgrades.OVERCLOCKER
for (def upgrade in TRContent.Upgrades.values()) {
condition inventoryChanged(upgrade)
}
}
def cellBattery = create {
parent copperCable
name "cellbattery"
icon TRContent.RED_CELL_BATTERY
condition inventoryChanged(TRContent.RED_CELL_BATTERY)
}
def batBox = create {
parent cellBattery
name "batbox"
icon TRContent.Machine.LOW_VOLTAGE_SU
condition placedBlock(TRContent.Machine.LOW_VOLTAGE_SU.block)
}
def mfe = create {
parent batBox
name "mfe"
icon TRContent.Machine.MEDIUM_VOLTAGE_SU
frame AdvancementFrame.GOAL
condition placedBlock(TRContent.Machine.MEDIUM_VOLTAGE_SU.block)
}
def lvTransformer = create {
parent batBox
name "lvtransformer"
icon TRContent.Machine.LV_TRANSFORMER
condition placedBlock(TRContent.Machine.LV_TRANSFORMER.block)
}
def mfsu = create {
parent mfe
name "mfsu"
icon TRContent.Machine.HIGH_VOLTAGE_SU
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.Machine.HIGH_VOLTAGE_SU.block)
}
def idsu = create {
parent mfsu
name "interdimensionalsu"
icon TRContent.Machine.INTERDIMENSIONAL_SU
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.Machine.INTERDIMENSIONAL_SU.block)
}
}
private void machineTree(Advancement root) {
def ironFurnace = create {
parent root
name "ironfurnace"
icon TRContent.Machine.IRON_FURNACE
condition placedBlock(TRContent.Machine.IRON_FURNACE.block)
}
// TODO fill this out some more
advancedMachineTreeTree(ironFurnace)
}
private void advancedMachineTreeTree(Advancement root) {
def advancedMachineBlock = create {
parent root
name "advancedmachineblock"
icon TRContent.MachineBlocks.ADVANCED.frame
condition placedBlock(TRContent.MachineBlocks.ADVANCED.frame)
}
def fusionCoil = create {
parent advancedMachineBlock
name "fusioncoil"
icon TRContent.Machine.FUSION_COIL
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.Machine.FUSION_COIL.block)
}
def nuke = create {
parent fusionCoil
name "nuke"
icon TRContent.NUKE
condition placedBlock(TRContent.NUKE)
hidden true
}
def industrialCentrifuge = create {
parent advancedMachineBlock
name "industrialcentrifuge"
icon TRContent.Machine.INDUSTRIAL_CENTRIFUGE
frame AdvancementFrame.GOAL
condition placedBlock(TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block)
}
def industrialMachineBlock = create {
parent advancedMachineBlock
name "industrialmachineblock"
icon TRContent.MachineBlocks.INDUSTRIAL.frame
condition placedBlock(TRContent.MachineBlocks.INDUSTRIAL.frame)
}
def quantumTank = create {
parent advancedMachineBlock
name "quantumtank"
icon TRContent.TankUnit.QUANTUM
frame AdvancementFrame.CHALLENGE
condition placedBlock(TRContent.TankUnit.QUANTUM.block)
}
} }
private static CriterionConditions placedBlock(Block block) { private static CriterionConditions placedBlock(Block block) {

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:advanced_machine_frame"
},
"title": {
"translate": "advancements.techreborn.advancedmachineblock"
},
"description": {
"translate": "advancements.techreborn.advancedmachineblock.desc"
}
},
"parent": "techreborn:root",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:advanced_machine_frame"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:advanced_solar_panel"
},
"title": {
"translate": "advancements.techreborn.advancedsolar"
},
"description": {
"translate": "advancements.techreborn.advancedsolar.desc"
}
},
"parent": "techreborn:basicsolar",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:advanced_solar_panel"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:alloy_smelter"
},
"title": {
"translate": "advancements.techreborn.alloysmelter"
},
"description": {
"translate": "advancements.techreborn.alloysmelter.desc"
}
},
"parent": "techreborn:ironalloyfurnace",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:alloy_smelter"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:basic_solar_panel"
},
"title": {
"translate": "advancements.techreborn.basicsolar"
},
"description": {
"translate": "advancements.techreborn.basicsolar.desc"
}
},
"parent": "techreborn:generator",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:basic_solar_panel"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:low_voltage_su"
},
"title": {
"translate": "advancements.techreborn.batbox"
},
"description": {
"translate": "advancements.techreborn.batbox.desc"
}
},
"parent": "techreborn:cellbattery",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:low_voltage_su"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:red_cell_battery"
},
"title": {
"translate": "advancements.techreborn.cellbattery"
},
"description": {
"translate": "advancements.techreborn.cellbattery.desc"
}
},
"parent": "techreborn:coppercable",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:red_cell_battery"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:insulated_copper_cable"
},
"title": {
"translate": "advancements.techreborn.coppercable"
},
"description": {
"translate": "advancements.techreborn.coppercable.desc"
}
},
"parent": "techreborn:rubber",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:insulated_copper_cable"]
}
]
}
}
}
}

View file

@ -1,27 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:fusion_coil"
},
"title": {
"translate": "advancements.techreborn.fusioncoil"
},
"description": {
"translate": "advancements.techreborn.fusioncoil.desc"
},
"frame": "goal"
},
"parent": "techreborn:advancedmachineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:fusion_coil"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:industrial_centrifuge"
},
"title": {
"translate": "advancements.techreborn.industrialcentrifuge"
},
"description": {
"translate": "advancements.techreborn.industrialcentrifuge.desc"
}
},
"parent": "techreborn:advancedmachineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:industrial_centrifuge"]
}
]
}
}
}
}

View file

@ -1,27 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:industrial_machine_frame"
},
"title": {
"translate": "advancements.techreborn.industrialmachineblock"
},
"description": {
"translate": "advancements.techreborn.industrialmachineblock.desc"
},
"frame": "goal"
},
"parent": "techreborn:advancedmachineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:industrial_machine_frame"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:industrial_solar_panel"
},
"title": {
"translate": "advancements.techreborn.industrialsolar"
},
"description": {
"translate": "advancements.techreborn.industrialsolar.desc"
}
},
"parent": "techreborn:advancedsolar",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:industrial_solar_panel"]
}
]
}
}
}
}

View file

@ -1,23 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:interdimensional_su"
},
"title": {
"translate": "advancements.techreborn.interdimensionalsu"
},
"description": {
"translate": "advancements.techreborn.interdimensionalsu.desc"
},
"frame": "challenge"
},
"parent": "techreborn:mfsu",
"criteria": {
"crit1": {
"trigger": "minecraft:placed_block",
"conditions": {
"block": "techreborn:interdimensional_su"
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:iron_alloy_furnace"
},
"title": {
"translate": "advancements.techreborn.ironalloyfurnace"
},
"description": {
"translate": "advancements.techreborn.ironalloyfurnace.desc"
}
},
"parent": "techreborn:machineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:iron_alloy_furnace"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:iron_furnace"
},
"title": {
"translate": "advancements.techreborn.ironfurnace"
},
"description": {
"translate": "advancements.techreborn.ironfurnace.desc"
}
},
"parent": "techreborn:machineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:iron_furnace"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:lv_transformer"
},
"title": {
"translate": "advancements.techreborn.lvtransformer"
},
"description": {
"translate": "advancements.techreborn.lvtransformer.desc"
}
},
"parent": "techreborn:batbox",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:lv_transformer"]
}
]
}
}
}
}

View file

@ -1,27 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:medium_voltage_su"
},
"title": {
"translate": "advancements.techreborn.mfe"
},
"description": {
"translate": "advancements.techreborn.mfe.desc"
},
"frame": "goal"
},
"parent": "techreborn:batbox",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:medium_voltage_su"]
}
]
}
}
}
}

View file

@ -1,27 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:high_voltage_su"
},
"title": {
"translate": "advancements.techreborn.mfsu"
},
"description": {
"translate": "advancements.techreborn.mfsu.desc"
},
"frame": "challenge"
},
"parent": "techreborn:mfe",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:high_voltage_su"]
}
]
}
}
}
}

View file

@ -1,23 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:nuke"
},
"title": {
"translate": "advancements.techreborn.nuke"
},
"description": {
"translate": "advancements.techreborn.nuke.desc"
},
"hidden": true
},
"parent": "techreborn:root",
"criteria": {
"crit1": {
"trigger": "minecraft:placed_block",
"conditions": {
"block": "techreborn:nuke"
}
}
}
}

View file

@ -1,23 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:quantum_solar_panel"
},
"title": {
"translate": "advancements.techreborn.quantumsolar"
},
"description": {
"translate": "advancements.techreborn.quantumsolar.desc"
},
"frame": "challenge"
},
"parent": "techreborn:ultimatesolar",
"criteria": {
"crit1": {
"trigger": "minecraft:placed_block",
"conditions": {
"block": "techreborn:quantum_solar_panel"
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:rubber"
},
"title": {
"translate": "advancements.techreborn.rubber"
},
"description": {
"translate": "advancements.techreborn.rubber.desc"
}
},
"parent": "techreborn:sap",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:rubber"]
}
]
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:sap"
},
"title": {
"translate": "advancements.techreborn.sap"
},
"description": {
"translate": "advancements.techreborn.sap.desc"
}
},
"parent": "techreborn:tree_tap",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:sap"]
}
]
}
}
}
}

View file

@ -1,23 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:quantum_tank_unit"
},
"title": {
"translate": "advancements.techreborn.quantumtank"
},
"description": {
"translate": "advancements.techreborn.quantumtank.desc"
},
"frame": "challenge"
},
"parent": "techreborn:industrialmachineblock",
"criteria": {
"crit1": {
"trigger": "minecraft:placed_block",
"conditions": {
"block": "techreborn:quantum_tank_unit"
}
}
}
}

View file

@ -1,26 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:treetap"
},
"title": {
"translate": "advancements.techreborn.treetap"
},
"description": {
"translate": "advancements.techreborn.treetap.desc"
}
},
"parent": "techreborn:root",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:treetap"]
}
]
}
}
}
}

View file

@ -1,27 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:ultimate_solar_panel"
},
"title": {
"translate": "advancements.techreborn.ultimatesolar"
},
"description": {
"translate": "advancements.techreborn.ultimatesolar.desc"
},
"frame": "goal"
},
"parent": "techreborn:industrialsolar",
"criteria": {
"crit1": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:ultimate_solar_panel"]
}
]
}
}
}
}

View file

@ -1,69 +0,0 @@
{
"display": {
"icon": {
"item": "techreborn:overclocker_upgrade"
},
"title": {
"translate": "advancements.techreborn.upgrade"
},
"description": {
"translate": "advancements.techreborn.upgrade.desc"
}
},
"parent": "techreborn:coppercable",
"criteria": {
"overclocker": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:overclocker_upgrade"]
}
]
}
},
"transformer": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:transformer_upgrade"]
}
]
}
},
"energystorage": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:energy_storage_upgrade"]
}
]
}
},
"superconductor": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:superconductor_upgrade"]
}
]
}
},
"muffler": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": ["techreborn:muffler_upgrade"]
}
]
}
}
},
"requirements": [
["overclocker", "transformer","energystorage","superconductor","muffler"]
]
}