Move door models & blockstates to Datagen

This commit is contained in:
Andrew-71 2023-09-16 14:52:16 +03:00
parent 5db68cbf85
commit c1c3120825
88 changed files with 266 additions and 233 deletions

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_bottom",
"top": "new_soviet:block/doors/chiseled_birch_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_bottom",
"top": "new_soviet:block/doors/chiseled_mangrove_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_bottom",
"top": "new_soviet:block/doors/chiseled_oak_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_bottom",
"top": "new_soviet:block/doors/chiseled_spruce_door_top"
}
}

View file

@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "new_soviet:item/doors/chiseled_birch_door"
"layer0": "new_soviet:item/chiseled_birch_door"
}
}

View file

@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "new_soviet:item/doors/chiseled_mangrove_door"
"layer0": "new_soviet:item/chiseled_mangrove_door"
}
}

View file

@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "new_soviet:item/doors/chiseled_oak_door"
"layer0": "new_soviet:item/chiseled_oak_door"
}
}

View file

@ -1,6 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "new_soviet:item/doors/chiseled_spruce_door"
"layer0": "new_soviet:item/chiseled_spruce_door"
}
}

View file

@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"new_soviet:caged_post_lamp",
"new_soviet:vintage_post_lamp",
"new_soviet:modern_post_lamp",
"new_soviet:big_post_lamp"
]
}

View file

@ -11,8 +11,7 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.data.client.BlockStateModelGenerator;
import net.minecraft.data.client.ItemModelGenerator;
import net.minecraft.data.client.*;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
import net.minecraft.data.server.recipe.RecipeProvider;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
@ -21,9 +20,11 @@ import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import su.a71.new_soviet.registration.NSE_Blocks;
import su.a71.new_soviet.registration.NSE_Custom;
@ -1785,17 +1786,40 @@ public class DataGeneration implements DataGeneratorEntrypoint {
}
}
// This is often used once to generate some model and then move it into "proper" assets folder
private static class ModelGenerator extends FabricModelProvider {
private ModelGenerator(FabricDataOutput generator) {
super(generator);
}
// Helper method since "normal" registerDoor doesn't account for non-flat texture dir
public void registerDoor(BlockStateModelGenerator blockStateModelGenerator, Block doorBlock) {
TextureMap textureMap = TextureMap.topBottom(
Registries.BLOCK.getId(doorBlock).withPath((path) -> "block/doors/" + path + "_top"),
Registries.BLOCK.getId(doorBlock).withPath((path) -> "block/doors/" + path + "_bottom"));
Identifier identifier = Models.DOOR_BOTTOM_LEFT.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier2 = Models.DOOR_BOTTOM_LEFT_OPEN.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier3 = Models.DOOR_BOTTOM_RIGHT.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier4 = Models.DOOR_BOTTOM_RIGHT_OPEN.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier5 = Models.DOOR_TOP_LEFT.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier6 = Models.DOOR_TOP_LEFT_OPEN.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier7 = Models.DOOR_TOP_RIGHT.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
Identifier identifier8 = Models.DOOR_TOP_RIGHT_OPEN.upload(doorBlock, textureMap, blockStateModelGenerator.modelCollector);
blockStateModelGenerator.registerItemModel(doorBlock.asItem());
blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createDoorBlockState(doorBlock, identifier, identifier2, identifier3, identifier4, identifier5, identifier6, identifier7, identifier8));
}
@Override
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
// BlockStateModelGenerator.createSingletonBlockState(NSE_Blocks.SAND_TILES, new Identifier("new_soviet", "block/sand_tiles"));
// BlockStateModelGenerator.createSlabBlockState()
// BlockStateModelGenerator.createWallBlockState()
// BlockStateModelGenerator.createStairsBlockState(NSE_Blocks.SAND_TILES_STAIRS, new Identifier(NewSoviet.MOD_ID, "sand_tiles_stairs"));
registerDoor(blockStateModelGenerator, NSE_Blocks.CHISELED_BIRCH_DOOR);
registerDoor(blockStateModelGenerator, NSE_Blocks.CHISELED_SPRUCE_DOOR);
registerDoor(blockStateModelGenerator, NSE_Blocks.CHISELED_OAK_DOOR);
registerDoor(blockStateModelGenerator, NSE_Blocks.CHISELED_MANGROVE_DOOR);
// blockStateModelGenerator.register();
}
@Override

View file

@ -1,4 +1,4 @@
package su.a71.new_soviet.Materials;
package su.a71.new_soviet.materials;
import net.fabricmc.yarn.constants.MiningLevels;
import net.minecraft.item.Items;

View file

@ -10,7 +10,7 @@ import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.Rarity;
import su.a71.new_soviet.Materials.NSE_ToolMaterials;
import su.a71.new_soviet.materials.NSE_ToolMaterials;
import su.a71.new_soviet.items.CigaretteItem;
import su.a71.new_soviet.items.DiceItem;
import su.a71.new_soviet.items.RakeItem;

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_birch_door_lower",
"top": "new_soviet:block/doors/chiseled_birch_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_mangrove_door_lower",
"top": "new_soviet:block/doors/chiseled_mangrove_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_oak_door_lower",
"top": "new_soviet:block/doors/chiseled_oak_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

View file

@ -1,7 +0,0 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"bottom": "new_soviet:block/doors/chiseled_spruce_door_lower",
"top": "new_soviet:block/doors/chiseled_spruce_door_upper"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B