-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6412ecd
commit 4aab60e
Showing
6 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
3 changes: 0 additions & 3 deletions
3
src/main/generated/assets/advanced_networking/models/item/cable.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/io/github/mattidragon/advancednetworking/datagen/ReadmeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} |