generated from calmilamsy/stationapi-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make target path defined in buildscript
Add tag providers Rename Ingredient to DataIngredient
- Loading branch information
1 parent
b98c218
commit ef1aff5
Showing
44 changed files
with
252 additions
and
77 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
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
2 changes: 2 additions & 0 deletions
2
src/generated/resources/assets/datagen_test/stationapi/lang/en_US.lang
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
item.datagen_test.dirty_ruby.name=Dirty Ruby | ||
item.datagen_test.gravelly_ruby.name=Gravelly Ruby | ||
tile.datagen_test.ruby_block.name=Block of Ruby | ||
item.datagen_test.sandy_ruby.name=Sandy Ruby | ||
item.datagen_test.ruby.name=Ruby | ||
item.datagen_test.ruby_rod.name=Ruby Rod | ||
|
1 change: 1 addition & 0 deletions
1
src/generated/resources/assets/datagen_test/stationapi/models/item/gravelly_ruby.json
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 @@ | ||
{"parent":"minecraft:item/generated","textures":{"layer0":"datagen_test:item/gravelly_ruby"}} |
1 change: 1 addition & 0 deletions
1
src/generated/resources/assets/datagen_test/stationapi/models/item/sandy_ruby.json
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 @@ | ||
{"parent":"minecraft:item/generated","textures":{"layer0":"datagen_test:item/sandy_ruby"}} |
1 change: 0 additions & 1 deletion
1
src/generated/resources/assets/datagen_test/stationapi/recipes/crafting/dirty_ruby.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...nerated/resources/assets/datagen_test/stationapi/recipes/smelting/dirty_ruby_to_ruby.json
This file was deleted.
Oops, something went wrong.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/recipes/crafting/dirty_ruby.json
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 @@ | ||
{"type":"minecraft:crafting_shapeless","ingredients":[{"item":"datagen_test:ruby"},{"item":"minecraft:dirt"},{"item":"minecraft:dirt"}],"result":{"item":"datagen_test:dirty_ruby"}} |
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/recipes/crafting/gravelly_ruby.json
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 @@ | ||
{"type":"minecraft:crafting_shapeless","ingredients":[{"item":"datagen_test:ruby"},{"item":"minecraft:gravel"},{"item":"minecraft:gravel"}],"result":{"item":"datagen_test:gravelly_ruby"}} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/recipes/crafting/sandy_ruby.json
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 @@ | ||
{"type":"minecraft:crafting_shapeless","ingredients":[{"item":"datagen_test:ruby"},{"item":"minecraft:sand"},{"item":"minecraft:sand"}],"result":{"item":"datagen_test:sandy_ruby"}} |
1 change: 1 addition & 0 deletions
1
...generated/resources/data/datagen_test/stationapi/recipes/smelting/dirty_ruby_to_ruby.json
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 @@ | ||
{"type":"minecraft:smelting","ingredient":{"tag":"datagen_test:dirty_ruby_gems"},"result":{"item":"datagen_test:ruby"}} |
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/tags/blocks/gem_blocks.json
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 @@ | ||
{"values":["minecraft:diamond_block","datagen_test:ruby_block"]} |
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/tags/items/dirty_ruby_gems.json
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 @@ | ||
{"values":["datagen_test:dirty_ruby","datagen_test:sandy_ruby","datagen_test:gravelly_ruby"]} |
1 change: 1 addition & 0 deletions
1
src/generated/resources/data/datagen_test/stationapi/tags/items/ruby_gems.json
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 @@ | ||
{"values":["datagen_test:ruby","datagen_test:dirty_ruby"]} |
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
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,12 @@ | ||
package emmathemartian.datagen; | ||
|
||
import java.nio.file.Path; | ||
|
||
public record DataTarget(String target) { | ||
public static final DataTarget ASSETS = new DataTarget("assets"); | ||
public static final DataTarget DATA = new DataTarget("data"); | ||
|
||
public Path getPath(DataGenContext context) { | ||
return context.getTargetPath(target); | ||
} | ||
} |
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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/emmathemartian/datagen/builder/TagBuilder.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,35 @@ | ||
package emmathemartian.datagen.builder; | ||
|
||
import com.google.gson.JsonArray; | ||
import com.google.gson.JsonObject; | ||
import emmathemartian.datagen.IDataBuilder; | ||
import net.modificationstation.stationapi.api.registry.Registry; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class TagBuilder<T> implements IDataBuilder { | ||
protected final Registry<T> registry; | ||
protected final List<T> entries = new ArrayList<>(); | ||
|
||
public TagBuilder(Registry<T> registry) { | ||
this.registry = registry; | ||
} | ||
|
||
public TagBuilder<T> add(T entry) { | ||
this.entries.add(entry); | ||
return this; | ||
} | ||
|
||
@Override | ||
public JsonObject build() { | ||
JsonObject object = new JsonObject(); | ||
|
||
JsonArray entriesArray = new JsonArray(); | ||
entries.forEach(it -> entriesArray.add(Objects.requireNonNull(registry.getId(it)).toString())); | ||
object.add("values", entriesArray); | ||
|
||
return object; | ||
} | ||
} |
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/emmathemartian/datagen/provider/BlockTagProvider.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,17 @@ | ||
package emmathemartian.datagen.provider; | ||
|
||
import emmathemartian.datagen.DataGenContext; | ||
import emmathemartian.datagen.builder.TagBuilder; | ||
import net.minecraft.block.Block; | ||
import net.modificationstation.stationapi.api.registry.BlockRegistry; | ||
|
||
public abstract class BlockTagProvider extends TagProvider<Block> { | ||
public BlockTagProvider(DataGenContext context) { | ||
super("blocks", "Block Tags", context); | ||
} | ||
|
||
@Override | ||
protected TagBuilder<Block> tag() { | ||
return new TagBuilder<>(BlockRegistry.INSTANCE); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/emmathemartian/datagen/provider/ItemTagProvider.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,17 @@ | ||
package emmathemartian.datagen.provider; | ||
|
||
import emmathemartian.datagen.DataGenContext; | ||
import emmathemartian.datagen.builder.TagBuilder; | ||
import net.minecraft.item.Item; | ||
import net.modificationstation.stationapi.api.registry.ItemRegistry; | ||
|
||
public abstract class ItemTagProvider extends TagProvider<Item> { | ||
public ItemTagProvider(DataGenContext context) { | ||
super("items", "Item Tags", context); | ||
} | ||
|
||
@Override | ||
protected TagBuilder<Item> tag() { | ||
return new TagBuilder<>(ItemRegistry.INSTANCE); | ||
} | ||
} |
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
Oops, something went wrong.