Skip to content

Commit

Permalink
Add AE2 to datagen mod tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jul 16, 2024
1 parent 2832a72 commit 8df8aac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -106,6 +107,8 @@ spotless {
kotlinGradle {
target("*.kts")
diktat()
indentWithSpaces(4)
endWithNewline()
}

java {
Expand Down
10 changes: 6 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run {
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.PREFER_SETTINGS
rulesMode = RulesMode.PREFER_SETTINGS

repositories {
mavenCentral()

Expand All @@ -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")

Expand Down
18 changes: 1 addition & 17 deletions src/data/java/gripe/_90/megacells/datagen/MEGAModelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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"));
Expand All @@ -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()));
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 8df8aac

Please sign in to comment.