Skip to content

Commit

Permalink
Make the mod build
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiDragon committed Oct 17, 2022
1 parent 6412ecd commit 4aab60e
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ maven_group=io.github.mattidragon
archives_base_name=advanced-networking

fabric_version=0.59.0+1.19.2
nodeflow_version=0.1.0-mc.1.19.2
nodeflow_version=v0.1.2-mc.1.19.2
graphlib_version=0.3.2+1.19
energy_version=2.2.0
3 changes: 3 additions & 0 deletions src/main/generated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated data
The data here is automatically generated and published only for reference for modpack and resource pack development.
Any changes made to it will be reverted next time data generation is run.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class AdvancedNetworkingDatagen implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator generator) {
generator.addProvider(ReadmeProvider::new);
generator.addProvider(ModelProvider::new);
generator.addProvider(RecipeProvider::new);
generator.addProvider(BlockLootTableProvider::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private void generateCableModel(BlockStateModelGenerator generator) {
}

generator.blockStateCollector.accept(builder);

generator.excludeFromSimpleItemModelGeneration(CABLE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package io.github.mattidragon.advancednetworking.datagen;

import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.DataProvider;
import net.minecraft.data.DataWriter;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class ReadmeProvider implements DataProvider {
private static final String README = """
# Generated data
The data here is automatically generated and published only for reference for modpack and resource pack development.
Any changes made to it will be reverted next time data generation is run.
""";
@SuppressWarnings({"deprecation", "UnstableApiUsage"})
private static final HashCode HASH = Hashing.sha1().hashUnencodedChars(README);

private final DataGenerator root;

public ReadmeProvider(DataGenerator root) {
this.root = root;
}

@Override
public void run(DataWriter writer) throws IOException {
var path = root.getOutput().resolve("README.md");

writer.write(path, README.getBytes(StandardCharsets.UTF_8), HASH);
}

@Override
public String getName() {
return "Readme";
}
}

0 comments on commit 4aab60e

Please sign in to comment.