From 8df8aacbe68f159edf21f11f2ff961c9d3364499 Mon Sep 17 00:00:00 2001 From: 90 Date: Tue, 16 Jul 2024 19:44:11 +0100 Subject: [PATCH] Add AE2 to datagen mod tracker --- build.gradle.kts | 5 ++++- settings.gradle.kts | 10 ++++++---- .../megacells/datagen/MEGAModelProvider.java | 18 +----------------- .../arseng}/mega_source_cell_housing.json | 0 4 files changed, 11 insertions(+), 22 deletions(-) rename src/{main/resources/data/arseng/recipes => unported/integration/arseng}/mega_source_cell_housing.json (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 8b43562b..c9bdc765 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -68,7 +68,8 @@ neoForge { "--mod", modId, "--all", "--output", file("src/generated/resources/").absolutePath, - "--existing", file("src/main/resources/").absolutePath + "--existing", file("src/main/resources/").absolutePath, + "--existing-mod", "ae2" ) sourceSet = sourceSets.getByName("data") } @@ -106,6 +107,8 @@ spotless { kotlinGradle { target("*.kts") diktat() + indentWithSpaces(4) + endWithNewline() } java { diff --git a/settings.gradle.kts b/settings.gradle.kts index 8c984e4b..4172305c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,7 +16,7 @@ run { dependencyResolutionManagement { repositoriesMode = RepositoriesMode.PREFER_SETTINGS rulesMode = RulesMode.PREFER_SETTINGS - + repositories { mavenCentral() @@ -37,14 +37,16 @@ run { } } } - + versionCatalogs { create("libs") { val mc = "1.21" version("minecraft", mc) - version("neoforge", "21.0.87-beta") + + val nf = mc.substringAfter('.') + version("neoforge", "${nf + (if (!nf.contains('.')) ".0" else "")}.87-beta") version("parchment", "2024.06.23") - + version("ae2", "19.0.12-alpha") library("ae2", "appeng", "appliedenergistics2").versionRef("ae2") diff --git a/src/data/java/gripe/_90/megacells/datagen/MEGAModelProvider.java b/src/data/java/gripe/_90/megacells/datagen/MEGAModelProvider.java index 9dd6b998..deb176ea 100644 --- a/src/data/java/gripe/_90/megacells/datagen/MEGAModelProvider.java +++ b/src/data/java/gripe/_90/megacells/datagen/MEGAModelProvider.java @@ -7,11 +7,9 @@ import net.minecraft.data.models.blockstates.PropertyDispatch; import net.minecraft.data.models.blockstates.Variant; import net.minecraft.data.models.blockstates.VariantProperties; -import net.minecraft.server.packs.PackType; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.neoforged.neoforge.client.model.generators.ConfiguredModel; import net.neoforged.neoforge.client.model.generators.ModelFile; -import net.neoforged.neoforge.client.model.generators.ModelProvider; import net.neoforged.neoforge.common.data.ExistingFileHelper; import appeng.api.orientation.BlockOrientation; @@ -30,14 +28,8 @@ import gripe._90.megacells.definition.MEGAItems; public class MEGAModelProvider extends AE2BlockStateProvider { - private static final ExistingFileHelper.ResourceType MODEL = - new ExistingFileHelper.ResourceType(PackType.CLIENT_RESOURCES, ".json", "models"); - - private final ExistingFileHelper existing; - public MEGAModelProvider(PackOutput output, ExistingFileHelper existing) { super(output, MEGACells.MODID, existing); - this.existing = existing; } @Override @@ -65,14 +57,12 @@ protected void registerStatesAndModels() { basicItem(MEGAItems.GREATER_ENERGY_CARD); basicItem(MEGAItems.COMPRESSION_CARD); - existing.trackGenerated(AppEng.makeId("item/storage_cell_led"), ModelProvider.TEXTURE); MEGAItems.getItemCells().forEach(this::cell); MEGAItems.getFluidCells().forEach(this::cell); MEGAItems.getChemicalCells().forEach(this::cell); cell(MEGAItems.BULK_ITEM_CELL); cell(MEGAItems.RADIOACTIVE_CHEMICAL_CELL); - existing.trackGenerated(AppEng.makeId("item/portable_cell_led"), ModelProvider.TEXTURE); MEGAItems.getItemPortables().forEach(cell -> portable(cell, "item")); MEGAItems.getFluidPortables().forEach(cell -> portable(cell, "fluid")); MEGAItems.getChemicalPortables().forEach(cell -> portable(cell, "chemical")); @@ -81,15 +71,12 @@ protected void registerStatesAndModels() { driveCell(MEGAItems.BULK_ITEM_CELL, 0); driveCell(MEGAItems.RADIOACTIVE_CHEMICAL_CELL, 2); - var craftingPattern = - AppEng.makeId("item/" + AEItems.CRAFTING_PATTERN.id().getPath()); - existing.trackGenerated(craftingPattern, ModelProvider.TEXTURE); itemModels() .singleTexture( MEGAItems.DECOMPRESSION_PATTERN.id().getPath(), mcLoc("item/generated"), "layer0", - craftingPattern); + AppEng.makeId("item/" + AEItems.CRAFTING_PATTERN.id().getPath())); simpleBlockWithItem(MEGABlocks.SKY_STEEL_BLOCK.block(), cubeAll(MEGABlocks.SKY_STEEL_BLOCK.block())); simpleBlockWithItem(MEGABlocks.SKY_BRONZE_BLOCK.block(), cubeAll(MEGABlocks.SKY_BRONZE_BLOCK.block())); @@ -265,9 +252,6 @@ private void interfaceOrProviderPart(ItemDefinition part) { var back = MEGACells.makeId("part/" + partName + "_back"); var sides = MEGACells.makeId("part/" + partName + "_sides"); - existing.trackGenerated(AppEng.makeId("part/interface_base"), MODEL); - existing.trackGenerated(AppEng.makeId("item/cable_interface"), MODEL); - models().singleTexture( "part/" + partName, AppEng.makeId("part/interface_base"), diff --git a/src/main/resources/data/arseng/recipes/mega_source_cell_housing.json b/src/unported/integration/arseng/mega_source_cell_housing.json similarity index 100% rename from src/main/resources/data/arseng/recipes/mega_source_cell_housing.json rename to src/unported/integration/arseng/mega_source_cell_housing.json