From cc756672a302275107447ad9c26cf6e15e12710c Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 18:55:04 +0100 Subject: [PATCH 01/41] Created example ModelProvider --- .../docs/datagen/FabricDocsModelProvider.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java diff --git a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java new file mode 100644 index 000000000..8be9f0214 --- /dev/null +++ b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java @@ -0,0 +1,23 @@ +package com.example.docs.datagen; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; + +import net.minecraft.data.client.BlockStateModelGenerator; +import net.minecraft.data.client.ItemModelGenerator; + +public class FabricDocsModelProvider extends FabricModelProvider { + public FabricDocsModelProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { + + } + + @Override + public void generateItemModels(ItemModelGenerator itemModelGenerator) { + + } +} From dbd321c18616b924604044b4aaf95a1a8294309c Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 18:57:52 +0100 Subject: [PATCH 02/41] Registered ModelProvider --- .../docs/datagen/FabricDocsReferenceDataGenerator.java | 2 ++ ...delProvider.java => FabricDocsReferenceModelProvider.java} | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename reference/1.21/src/client/java/com/example/docs/datagen/{FabricDocsModelProvider.java => FabricDocsReferenceModelProvider.java} (77%) diff --git a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java index ad940193f..a8c8577fc 100644 --- a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java +++ b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java @@ -35,6 +35,8 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { pack.addProvider(FabricDocsReferenceDamageTypesProvider.TaterDamageTypesGenerator::new); pack.addProvider(FabricDocsReferenceDamageTypesProvider.TaterDamageTypeTagGenerator::new); + pack.addProvider(FabricDocsReferenceModelProvider::new); + // :::datagen-setup:generator } diff --git a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java similarity index 77% rename from reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java rename to reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java index 8be9f0214..e08724ed2 100644 --- a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsModelProvider.java +++ b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -6,8 +6,8 @@ import net.minecraft.data.client.BlockStateModelGenerator; import net.minecraft.data.client.ItemModelGenerator; -public class FabricDocsModelProvider extends FabricModelProvider { - public FabricDocsModelProvider(FabricDataOutput output) { +public class FabricDocsReferenceModelProvider extends FabricModelProvider { + public FabricDocsReferenceModelProvider(FabricDataOutput output) { super(output); } From 0215b1c5e347395b420adc7ec1fc5f76ca00dff4 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 19:03:42 +0100 Subject: [PATCH 03/41] Added an example block --- .../src/main/java/com/example/docs/block/ModBlocks.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java index de1c61733..f72f0467f 100644 --- a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java @@ -18,6 +18,10 @@ import com.example.docs.block.custom.PrismarineLampBlock; import com.example.docs.item.ModItems; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Function; + // :::1 public class ModBlocks { // :::1 @@ -55,6 +59,9 @@ public class ModBlocks { new CounterBlock(AbstractBlock.Settings.create()), "counter_block", true ); // :::5 + public static final Block QUESTION_BLOCK = register( + new Block(AbstractBlock.Settings.create()), "question_block", true + ); // :::1 public static Block register(Block block, String name, boolean shouldRegisterItem) { From f9bfaeeec64ec58bda05428e9baf115ce32e156a Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 19:12:20 +0100 Subject: [PATCH 04/41] Revert since I created the files in the wrong version. srry bout that --- .../FabricDocsReferenceDataGenerator.java | 2 -- .../FabricDocsReferenceModelProvider.java | 23 ------------------- .../com/example/docs/block/ModBlocks.java | 3 --- 3 files changed, 28 deletions(-) delete mode 100644 reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java diff --git a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java index a8c8577fc..ad940193f 100644 --- a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java +++ b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java @@ -35,8 +35,6 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { pack.addProvider(FabricDocsReferenceDamageTypesProvider.TaterDamageTypesGenerator::new); pack.addProvider(FabricDocsReferenceDamageTypesProvider.TaterDamageTypeTagGenerator::new); - pack.addProvider(FabricDocsReferenceModelProvider::new); - // :::datagen-setup:generator } diff --git a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java b/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java deleted file mode 100644 index e08724ed2..000000000 --- a/reference/1.21/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.docs.datagen; - -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; -import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; - -import net.minecraft.data.client.BlockStateModelGenerator; -import net.minecraft.data.client.ItemModelGenerator; - -public class FabricDocsReferenceModelProvider extends FabricModelProvider { - public FabricDocsReferenceModelProvider(FabricDataOutput output) { - super(output); - } - - @Override - public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { - - } - - @Override - public void generateItemModels(ItemModelGenerator itemModelGenerator) { - - } -} diff --git a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java index f72f0467f..a7f93d371 100644 --- a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java @@ -59,9 +59,6 @@ public class ModBlocks { new CounterBlock(AbstractBlock.Settings.create()), "counter_block", true ); // :::5 - public static final Block QUESTION_BLOCK = register( - new Block(AbstractBlock.Settings.create()), "question_block", true - ); // :::1 public static Block register(Block block, String name, boolean shouldRegisterItem) { From f63d2bff774db55380464c215cd96ca49ce3a6a2 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 19:25:10 +0100 Subject: [PATCH 05/41] Added the example ModelProvider and registered it --- .../FabricDocsReferenceDataGenerator.java | 2 ++ .../FabricDocsReferenceModelProvider.java | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java index d92bb3c3f..a43fa1f3e 100644 --- a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceDataGenerator.java @@ -38,6 +38,8 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { pack.addProvider(FabricDocsReferenceInternalModelProvider::new); + pack.addProvider(FabricDocsReferenceModelProvider::new); + // :::datagen-setup:generator } diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java new file mode 100644 index 000000000..7c8856c6b --- /dev/null +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -0,0 +1,30 @@ +package com.example.docs.datagen; + +// :::datagen-model:provider +import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; + +import net.minecraft.client.data.BlockStateModelGenerator; +import net.minecraft.client.data.ItemModelGenerator; + +public class FabricDocsReferenceModelProvider extends FabricModelProvider { + public FabricDocsReferenceModelProvider(FabricDataOutput output) { + super(output); + } + + @Override + public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { + // :::datagen-model:provider + + // :::datagen-model:provider + } + + @Override + public void generateItemModels(ItemModelGenerator itemModelGenerator) { + // :::datagen-model:provider + + // :::datagen-model:provider + } +} +// :::datagen-model:provider From a0449213e3146535eb78578b03343b4cc59a7e1e Mon Sep 17 00:00:00 2001 From: Fellteros Date: Fri, 17 Jan 2025 20:32:00 +0100 Subject: [PATCH 06/41] created the actual page and added it to the sidebar --- .vitepress/sidebars/develop.ts | 6 +++++- develop/data-generation/models.md | 34 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 develop/data-generation/models.md diff --git a/.vitepress/sidebars/develop.ts b/.vitepress/sidebars/develop.ts index fbe2f1525..07c08e15d 100644 --- a/.vitepress/sidebars/develop.ts +++ b/.vitepress/sidebars/develop.ts @@ -232,7 +232,11 @@ export default [ { text: "develop.dataGeneration.lootTables", link: "/develop/data-generation/loot-tables" - } + }, + { + text: "develop.dataGeneration.models", + link: "/develop/data-generation/models" + } ] }, { diff --git a/develop/data-generation/models.md b/develop/data-generation/models.md new file mode 100644 index 000000000..de2be0d0f --- /dev/null +++ b/develop/data-generation/models.md @@ -0,0 +1,34 @@ +--- +title: Model Generation +description: A guide to generating models, item models and blockstates via datagen +authors: + - Fellteros +--- + +# Model Generation {#model-generation} + +::: info PREREQUISITES +Make sure you've completed the [datagen setup](./setup) process first. +::: + +## Setup {#setup} + +First, we will need to create our ModelProvider. Create a plain Java class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. +Lastly, create constructor matching super. + +:::tip +If you're developing mods in JetBrains' Intellij Idea, you can press `Alt+Shift+Enter` while hovering over the problem to bring up a quick fix menu! +::: + +@[code lang=java transcludeWith=:::datagen-model:provider](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. + +## Blockstates and block models {#blockstates-and-block-models} + +::: info PREREQUISITES +You'll have to register the blocks, to which you want the data to be generated. +::: + +This part of the tutorial will happen entirely in the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this class will be responsible for generating all the JSON files. +Here are some examples you can use to generate your desired models: From eaadf7c1823e0305b66bd023ba99d07b89204ef3 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 10:47:21 +0100 Subject: [PATCH 07/41] Added Simple Cube All, Singletons and Block Texture Pool chapters --- develop/data-generation/models.md | 58 +++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/develop/data-generation/models.md b/develop/data-generation/models.md index de2be0d0f..9856111ba 100644 --- a/develop/data-generation/models.md +++ b/develop/data-generation/models.md @@ -27,8 +27,62 @@ Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDa ## Blockstates and block models {#blockstates-and-block-models} ::: info PREREQUISITES -You'll have to register the blocks, to which you want the data to be generated. +You'll have to register the blocks, to which you want the data to be generated. Also see the blockstate and first block tutorials. ::: This part of the tutorial will happen entirely in the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this class will be responsible for generating all the JSON files. -Here are some examples you can use to generate your desired models: +Here are some handy examples you can use to generate your desired models: + +### Simple Cube All {#simple-cube-all} + +@[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. It provides the same texture (named `steel_block`) for all six sides. + +```json +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/steel_block" + } +} +``` + +It also generates a blockstate JSON file. Since we have no blockstates (e.g. Axis, Facing, ...), one variant is sufficient, and is used everytime the block is placed. + +```json +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/steel_block" + } + } +} +``` + +### Singletons {#singletons} + +The `registerSingleton` method provides JSON model files based on the `TexturedModel` you pass in and a single blockstate variant. For example + +@[code lang=java transcludeWith=:::datagen-model:cube-top-for-ends](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +will generate models for a normal cube, that uses a PNG file `pipe_block_side` for the sides and a PNG file `pipe_block_top` for the top and bottom sides. + +:::tip +If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the `TextureMaps`! +::: + +### Block Texture Pool {#block-texture-pool} + +@[code lang=java transcludeWith=:::datagen-model:block-texture-pool](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures.
+In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. +***It will also generate a [simple cube all JSON model](#simple-cube-all-simple-cube-all) for the "base block" to ensure the texture provision!*** + +::: warning +Make sure you're using the correct Block class when passing in the block! +For example, in the `.stairs()` method, you have to pass in an instance of StairsBlock; in `.slab()`, it has to be an instance of SlabBlock and so on! +::: + + From caa5ce77adea52d43ff7195aea5060517ca2f1ef Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 11:31:21 +0100 Subject: [PATCH 08/41] Added the Model Generation translation --- sidebar_translations.json | 1 + 1 file changed, 1 insertion(+) diff --git a/sidebar_translations.json b/sidebar_translations.json index 23dd41fc7..9ecb78ba5 100644 --- a/sidebar_translations.json +++ b/sidebar_translations.json @@ -49,6 +49,7 @@ "develop.dataGeneration.advancements": "Advancement Generation", "develop.dataGeneration.recipes": "Recipe Generation", "develop.dataGeneration.lootTables": "Loot Table Generation", + "develop.dataGeneration.models": "Model Generation", "develop.rendering": "Rendering", "develop.rendering.basicConcepts": "Basic Rendering Concepts", "develop.rendering.drawContext": "Using the Drawing Context", From 8e33244da0a568e2789e4b043bdf453dd1311381 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 11:47:25 +0100 Subject: [PATCH 09/41] Added textures to Ruby Block, Door, Trapdoor and Steel Block --- .../textures/block/ruby_block.png | Bin 0 -> 393 bytes .../textures/block/ruby_door_bottom.png | Bin 0 -> 388 bytes .../textures/block/ruby_door_top.png | Bin 0 -> 388 bytes .../textures/block/ruby_trapdoor.png | Bin 0 -> 393 bytes .../textures/block/steel_block.png | Bin 0 -> 1198 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_block.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_door_bottom.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_door_top.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_trapdoor.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/steel_block.png diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_block.png b/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_block.png new file mode 100644 index 0000000000000000000000000000000000000000..75c79bc311090c23aa156220064eb8619303c4bf GIT binary patch literal 393 zcmV;40e1e0P)Px$LrFwIR5*>DlfP=hP!z_0CYRvQB}=Xe^Z{IyLY6>R$4)+5AEBFfC@w-*K@g#} zeTQgVTt%vONX|7^W1;<)BZ9b$FO9@UzrD0aj)VK$OG) zylhmt0N~wBuPMxwf&gvLLI9TekwM}ClnV~C1pvLIZP}#0$yd(KD2aK?kM>&u<&c@; zXK90y(D6K|-u*0v*N?M>I_jB-IzLO9n0cj0mwBjr*Fqgq6ARHr&$?3PH4O>sdEA26 z)F|Pt%$PMHOEjPP&SCDbJuhgoASei&fkp+=D1QAcwU%9(P7P1aozPO_`qI>GFW%&zB69$Rr{tKGD4eB!K%UYDg n_9nKT>7O<#_!GMz`rh*cB-4Wur5P%y00000NkvXXu0mjfX9la? literal 0 HcmV?d00001 diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_door_bottom.png b/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/ruby_door_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..624b156c581223acbf932586d7f5649cd22926bc GIT binary patch literal 388 zcmV-~0ek+5P)Px$K1oDDR5*=|lDkgBFcgNrhA3iS=@Q3&gDymsSdhAQ?38EY5!mVhWkKp%2?-&U z!aF2QmaJ6;l%X8U4khAWe9`gwFFvCsljF3Qv9W71I(Ce?HkSZg+}^OUYZ?+12O1J` z8n!6rCSp~65#d1>3%75p8i0lbfQ*hl+BgXtd_KK6=G16vTcS7wk9LfMbL2k^y7v?a z`br{U^jCn?Xmqh~3WPZ|I;agS^ikW=DVP?sKv`|eVGDp$kkkCC5k+T1^l>hIA3+9w zqqeH4ZOM)?TNH2AK46x{gBD>P0B{)yWJ*Oz43eyJjUMguPr2NwKNZGs z`dd})(ZvD{&btp`7P5?vcdi&MnH)1ZwgW8ZFgFqRZG2K7UL~l0(*3*C=+nPx$K1oDDR5*>Dlf7!gKoEq#NJ6-EBjpbA0BIZoY6NLrs?sy2%N4_BXc6$rUZ7DCSs iZwll6+Pd1&Psbn6YmBh8b9HwB0000Px$LrFwIR5*>DlfP=hP!z_0CYRvQB}=Xe^Z{IyLY6>R$4)+5AEBFfC@w-*K@g#} zeTQgVTt%vONX|7^W1;<)BZ9b$FO9@UzrD0aj)VK$OG) zylhmt0N~wBuPMxwf&gvLLI9TekwM}ClnV~C1pvLIZP}#0$yd(KD2aK?kM>&u<&c@; zXK90y(D6K|-u*0v*N?M>I_jB-IzLO9n0cj0mwBjr*Fqgq6ARHr&$?3PH4O>sdEA26 z)F|Pt%$PMHOEjPP&SCDbJuhgoASei&fkp+=D1QAcwU%9(P7P1aozPO_`qI>GFW%&zB69$Rr{tKGD4eB!K%UYDg n_9nKT>7O<#_!GMz`rh*cB-4Wur5P%y00000NkvXXu0mjfX9la? literal 0 HcmV?d00001 diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/steel_block.png b/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/steel_block.png new file mode 100644 index 0000000000000000000000000000000000000000..2a5f6549b32d31b5a62ec984a7fcb6477a23cf23 GIT binary patch literal 1198 zcmd^;v5ONy6vm&VxVu1b5riNSr!&oB_GF7euXsn+GaxaW+#)Ae7&ORX_0)ic)pQ0F zLF6FCfo;$uty=`;EROYvVs{FzR${e{Xkqc3xoQ{YKk&^r?+xGY%@o7TqfUFRQa)7% zfJ*Cfv#YCP=3+_bx_i8*%dvaiwN==i*M0(&pmSwC&?dk{5133$(j_v>$OP*VF`IN$ z^ip>_jw6KdeLn~S-82{shQr}#G#Zb`dSe{NNs^>#nq}EhKO?XLo`K%1HDgc=s1M46 zoNEV4@s8q|;#4skrL1PGcDM*~t{ucNCo!inXEC!;#&ODV!bOmC?ErvkKoTedBBO{v z64a;&a;_anNr9wDQeP4o^+`q~11f@?YX@OS8zJ>W+6sw`wkYgVxIsmbbL{{C9Y6u- z0iuzIAP^iZf}CpyLSS8>Cr}DRBZtPY(Tstt& z+!kkF9NyLc0`7O)J^eiY>nLykx~T7{(`w>+^?CHtv2;Fou>beN;pbN;_7*;! z-k&z^oNL~?G`%+LeOs Date: Sat, 18 Jan 2025 13:12:08 +0100 Subject: [PATCH 10/41] Added textures to Ruby Door and Pipe Block --- .../textures/block/pipe_block.png | Bin 0 -> 130 bytes .../textures/block/pipe_block_top.png | Bin 0 -> 221 bytes .../textures/item/ruby_door.png | Bin 0 -> 315 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block_top.png create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/item/ruby_door.png diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block.png b/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block.png new file mode 100644 index 0000000000000000000000000000000000000000..12d43aaf60c28506a01e7cdb1c52441cc536b388 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Y&=~YLo9mV zo-t%>VBk4&prL8TiY2Soca}2s@%Xbyv?tDnm{r-UW|@l_~@ literal 0 HcmV?d00001 diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block_top.png b/reference/latest/src/main/resources/assets/fabric-docs-reference/textures/block/pipe_block_top.png new file mode 100644 index 0000000000000000000000000000000000000000..2c6dbf3fced778167ea558b8046ee43aea6285f8 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|rhB?LhFJ8@ z4RqvdP~chJ#{MSMrf>P%Ez94qR~_ovwQ^%;Px#^+`lQR5*>rk~?n0Fc3svB7sPeMvZXBG5seLvHIBBAzA4f#ll7oS4 z6;MzPhN86A7zGqTIhliT2IJQoJeukZh}#{E(IN;rS??zTEdp89+P+$$4b~REHaqy6 zylH(_2Y_{DH#rFC2szQ<>E0VW;P->&az;RX)g!L}Iw~9``2FQfegN|GOkZU;fzSW| N002ovPDHLkV1f;!focE% literal 0 HcmV?d00001 From 2e7138311af2d662768f7179e20e2969e5dc9593 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 13:56:49 +0100 Subject: [PATCH 11/41] Added page for item model generation. Feel free to complete it, I won't. --- develop/data-generation/item-models.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 develop/data-generation/item-models.md diff --git a/develop/data-generation/item-models.md b/develop/data-generation/item-models.md new file mode 100644 index 000000000..1941b7697 --- /dev/null +++ b/develop/data-generation/item-models.md @@ -0,0 +1,10 @@ +--- +title: Item Model Generation +description: A guide to generating item models and item model definitions via datagen. +authors: + - Fellteros +--- + +# Item Model Generation {#item-model-generation} + +Yet to be completed. \ No newline at end of file From e1dd6e1202078c664d9625dc90545602773f3211 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:45:14 +0100 Subject: [PATCH 12/41] Added the Item Model Generation Page, renamed models.md to block-models.md --- .vitepress/sidebars/develop.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.vitepress/sidebars/develop.ts b/.vitepress/sidebars/develop.ts index 07c08e15d..7fd3103af 100644 --- a/.vitepress/sidebars/develop.ts +++ b/.vitepress/sidebars/develop.ts @@ -234,8 +234,12 @@ export default [ link: "/develop/data-generation/loot-tables" }, { - text: "develop.dataGeneration.models", - link: "/develop/data-generation/models" + text: "develop.dataGeneration.blockModels", + link: "/develop/data-generation/block-models" + }, + { + text: "develop.dataGeneration.itemModels", + link: "/develop/data-generation/item-models" } ] }, From 40f0bb0686c153c4f11b4a652ccb3fa59a99d918 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:45:50 +0100 Subject: [PATCH 13/41] Added translations for all blocks from Model Generation tutorial. --- .../FabricDocsReferenceEnglishLangProvider.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceEnglishLangProvider.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceEnglishLangProvider.java index 96c72ffb6..f3753e6a0 100644 --- a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceEnglishLangProvider.java +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceEnglishLangProvider.java @@ -57,6 +57,16 @@ public void generateTranslations(RegistryWrapper.WrapperLookup wrapperLookup, Tr translationBuilder.add(ModBlocks.COUNTER_BLOCK.asItem(), "Counter Block"); translationBuilder.add(ModBlocks.PRISMARINE_LAMP.asItem(), "Prismarine Lamp"); translationBuilder.add(ModBlocks.ENGINE_BLOCK.asItem(), "Engine Block"); + + translationBuilder.add(ModBlocks.STEEL_BLOCK, "Steel Block"); + translationBuilder.add(ModBlocks.PIPE_BLOCK, "Pipe Block"); + translationBuilder.add(ModBlocks.RUBY_BLOCK, "Ruby Block"); + translationBuilder.add(ModBlocks.RUBY_STAIRS, "Ruby Stairs"); + translationBuilder.add(ModBlocks.RUBY_SLAB, "Ruby Slab"); + translationBuilder.add(ModBlocks.RUBY_FENCE, "Ruby Fence"); + translationBuilder.add(ModBlocks.RUBY_DOOR, "Ruby Door"); + translationBuilder.add(ModBlocks.RUBY_TRAPDOOR, "Ruby Trapdoor"); + translationBuilder.add(ModBlocks.VERTICAL_OAK_LOG_SLAB, "Vertical Oak Log Slab"); // :::datagen-translations:provider } } From 521d20797265cd9ba9cf647d0e91a04711647ff2 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:46:26 +0100 Subject: [PATCH 14/41] Added needed methods --- .../FabricDocsReferenceModelProvider.java | 133 +++++++++++++++++- 1 file changed, 132 insertions(+), 1 deletion(-) diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java index 7c8856c6b..0e756a6d4 100644 --- a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -1,12 +1,32 @@ package com.example.docs.datagen; // :::datagen-model:provider -import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider; +import com.example.docs.FabricDocsReference; +import com.example.docs.block.ModBlocks; +import com.example.docs.block.custom.VerticalSlabBlock; +import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; import net.minecraft.client.data.BlockStateModelGenerator; +import net.minecraft.client.data.BlockStateSupplier; +import net.minecraft.client.data.BlockStateVariant; +import net.minecraft.client.data.BlockStateVariantMap; import net.minecraft.client.data.ItemModelGenerator; +import net.minecraft.client.data.Model; +import net.minecraft.client.data.ModelIds; +import net.minecraft.client.data.TextureKey; +import net.minecraft.client.data.TextureMap; +import net.minecraft.client.data.TexturedModel; +import net.minecraft.client.data.VariantSetting; +import net.minecraft.client.data.VariantSettings; +import net.minecraft.client.data.VariantsBlockStateSupplier; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.Direction; + +import java.util.Optional; public class FabricDocsReferenceModelProvider extends FabricModelProvider { public FabricDocsReferenceModelProvider(FabricDataOutput output) { @@ -17,14 +37,125 @@ public FabricDocsReferenceModelProvider(FabricDataOutput output) { public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { // :::datagen-model:provider + // :::datagen-model:cube-all + blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.STEEL_BLOCK); + // :::datagen-model:cube-all + + // :::datagen-model:cube-top-for-ends + blockStateModelGenerator.registerSingleton(ModBlocks.PIPE_BLOCK, TexturedModel.END_FOR_TOP_CUBE_COLUMN); + // :::datagen-model:cube-top-for-ends + + // :::datagen-model:block-texture-pool-normal + blockStateModelGenerator.registerCubeAllModelTexturePool(ModBlocks.RUBY_BLOCK) + .stairs(ModBlocks.RUBY_STAIRS) + .slab(ModBlocks.RUBY_SLAB) + .fence(ModBlocks.RUBY_FENCE); + // :::datagen-model:block-texture-pool-normal + + // :::datagen-model:door-and-trapdoor + blockStateModelGenerator.registerDoor(ModBlocks.RUBY_DOOR); + blockStateModelGenerator.registerTrapdoor(ModBlocks.RUBY_TRAPDOOR); + // blockStateModelGenerator.registerOrientableTrapdoor(ModBlocks.RUBY_TRAPDOOR); + // :::datagen-model:door-and-trapdoor + + // :::datagen-model-custom:method-call + CustomBlockStateModelGenerator.registerVerticalSlab( + blockStateModelGenerator, + ModBlocks.VERTICAL_OAK_LOG_SLAB, + Blocks.OAK_LOG, + CustomBlockStateModelGenerator.blockAndTopForEnds(Blocks.OAK_LOG) + ); + // :::datagen-model-custom:method-call + + + // :::datagen-model:provider } + // :::datagen-model:provider + + + + // used just for examples, not for actual data generation + @SuppressWarnings("unused") + public void exampleBlockStateGeneration(BlockStateModelGenerator blockStateModelGenerator) { + // :::datagen-model:block-texture-pool-family + blockStateModelGenerator.registerCubeAllModelTexturePool(ModBlocks.RUBY_BLOCK).family(ModBlocks.RUBY_FAMILY); + // :::datagen-model:block-texture-pool-family + } + + // :::datagen-model:provider @Override public void generateItemModels(ItemModelGenerator itemModelGenerator) { // :::datagen-model:provider + //TODO Since I have little experience with generating item models, I will leave this to someone more experienced (Fellteros) + // :::datagen-model:provider } + + // :::datagen-model:provider + + + // Inner class containing all Objects needed for the custom datagen tutorial. + public static class CustomBlockStateModelGenerator { + + // :::datagen-model-custom:model + public static final Model VERTICAL_SLAB = block("vertical_slab", TextureKey.BOTTOM, TextureKey.TOP, TextureKey.SIDE); + + //helper method for creating Models + private static Model block(String parent, TextureKey... requiredTextureKeys) { + return new Model(Optional.of(Identifier.of(FabricDocsReference.MOD_ID, "block/" + parent)), Optional.empty(), requiredTextureKeys); + } + + //helper method for creating Models with variants + private static Model block(String parent, String variant, TextureKey... requiredTextureKeys) { + return new Model(Optional.of(Identifier.of(FabricDocsReference.MOD_ID, "block/" + parent)), Optional.of(variant), requiredTextureKeys); + } + // :::datagen-model-custom:model + + // :::datagen-model-custom:texture-map + public static TextureMap blockAndTopForEnds(Block block) { + return new TextureMap() + .put(TextureKey.TOP, ModelIds.getBlockSubModelId(block, "_top")) + .put(TextureKey.BOTTOM, ModelIds.getBlockSubModelId(block, "_top")) + .put(TextureKey.SIDE, ModelIds.getBlockModelId(block)); + } + // :::datagen-model-custom:texture-map + + // :::datagen-model-custom:supplier + private static BlockStateSupplier createVerticalSlabBlockStates(Block vertSlabBlock, Identifier vertSlabId, Identifier fullBlockId) { + VariantSetting uvlock = VariantSettings.UVLOCK; + VariantSetting yRot = VariantSettings.Y; + return VariantsBlockStateSupplier.create(vertSlabBlock).coordinate(BlockStateVariantMap.create(VerticalSlabBlock.FACING, VerticalSlabBlock.SINGLE) + .register(Direction.NORTH, true, BlockStateVariant.create().put(VariantSettings.MODEL, vertSlabId).put(uvlock, true)) + .register(Direction.EAST, true, BlockStateVariant.create().put(VariantSettings.MODEL, vertSlabId).put(uvlock, true).put(yRot, VariantSettings.Rotation.R90)) + .register(Direction.SOUTH, true, BlockStateVariant.create().put(VariantSettings.MODEL, vertSlabId).put(uvlock, true).put(yRot, VariantSettings.Rotation.R180)) + .register(Direction.WEST, true, BlockStateVariant.create().put(VariantSettings.MODEL, vertSlabId).put(uvlock, true).put(yRot, VariantSettings.Rotation.R270)) + .register(Direction.NORTH, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true)) + .register(Direction.EAST, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true)) + .register(Direction.SOUTH, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true)) + .register(Direction.WEST, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true))); + } + // :::datagen-model-custom:supplier + + // :::datagen-model-custom:gen + public static void registerVerticalSlab(BlockStateModelGenerator bsmg, Block vertSlabBlock, Block fullBlock, TextureMap textures) { + Identifier identifier = VERTICAL_SLAB.upload(vertSlabBlock, textures, bsmg.modelCollector); + Identifier identifier2 = ModelIds.getBlockModelId(fullBlock); + bsmg.blockStateCollector.accept(createVerticalSlabBlockStates(vertSlabBlock, identifier, identifier2)); + bsmg.registerParentedItemModel(vertSlabBlock, identifier); + } + // :::datagen-model-custom:gen + + + } + + + // :::datagen-model:provider + @Override + public String getName() { + return "FabricDocsReference Model Provider"; + } } // :::datagen-model:provider From 58fe6b94152ec021229a022d49d7170c9d2fc930 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:47:50 +0100 Subject: [PATCH 15/41] Added a new helper method for easier addition of Items --- .../main/java/com/example/docs/item/ModItems.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/reference/latest/src/main/java/com/example/docs/item/ModItems.java b/reference/latest/src/main/java/com/example/docs/item/ModItems.java index 0a87c31d7..0a06b4929 100644 --- a/reference/latest/src/main/java/com/example/docs/item/ModItems.java +++ b/reference/latest/src/main/java/com/example/docs/item/ModItems.java @@ -33,6 +33,8 @@ import com.example.docs.item.custom.CounterItem; import com.example.docs.item.custom.LightningStick; +import java.util.function.Function; + // :::1 public class ModItems { // :::1 @@ -109,6 +111,19 @@ public class ModItems { ); // :::2 + /**Helper methods for registering items (Fellteros)
+ * Item registration would like this: + *
+	 *     public static final Item TEST = registerItem("test", Item::new)
+	 * 
*/ + private static Item registerItem(String name, Function function) { + return Registry.register(Registries.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name), function.apply(new Item.Settings().registryKey(keyOfItem(name)))); + } + private static RegistryKey keyOfItem(String name) { + return RegistryKey.of(RegistryKeys.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name)); + } + + // :::1 public static Item register(Item item, RegistryKey registryKey) { // Register the item. From c48517313e718f72361ecbe41906631cf384dbe0 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:48:20 +0100 Subject: [PATCH 16/41] Added example blocks and a new helper method for Model Generation --- .../com/example/docs/block/ModBlocks.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java index d503a9bb8..5efb4bbac 100644 --- a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java @@ -1,8 +1,18 @@ package com.example.docs.block; +import com.example.docs.block.custom.VerticalSlabBlock; + import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; +import net.minecraft.block.BlockSetType; +import net.minecraft.block.DoorBlock; +import net.minecraft.block.FenceBlock; +import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.block.PillarBlock; +import net.minecraft.block.SlabBlock; +import net.minecraft.block.StairsBlock; +import net.minecraft.block.TrapdoorBlock; +import net.minecraft.data.family.BlockFamily; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.registry.Registries; @@ -20,6 +30,10 @@ import com.example.docs.block.custom.PrismarineLampBlock; import com.example.docs.item.ModItems; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Function; + // :::1 public class ModBlocks { // :::1 @@ -84,6 +98,38 @@ public class ModBlocks { ); // :::5 + public static final Block STEEL_BLOCK = registerBlock( + "steel_block", PillarBlock::new, AbstractBlock.Settings.create() + ); + public static final Block PIPE_BLOCK = registerBlock( + "pipe_block", Block::new, AbstractBlock.Settings.create() + ); + + public static final Block RUBY_BLOCK = registerBlock( + "ruby_block", Block::new, AbstractBlock.Settings.create() + ); + public static final Block RUBY_STAIRS = registerBlock( + "ruby_stairs", settings -> new StairsBlock(RUBY_BLOCK.getDefaultState(), settings), AbstractBlock.Settings.create() + ); + public static final Block RUBY_SLAB = registerBlock( + "ruby_slab", SlabBlock::new, AbstractBlock.Settings.create() + ); + public static final Block RUBY_FENCE = registerBlock( + "ruby_fence", FenceBlock::new, AbstractBlock.Settings.create() + ); + + public static final Block RUBY_DOOR = registerBlock( + "ruby_door", settings -> new DoorBlock(BlockSetType.STONE, settings), AbstractBlock.Settings.create() + ); + public static final Block RUBY_TRAPDOOR = registerBlock( + "ruby_trapdoor", settings -> new TrapdoorBlock(BlockSetType.STONE, settings), AbstractBlock.Settings.create() + ); + + public static final Block VERTICAL_OAK_LOG_SLAB = registerBlock( + "vertical_oak_log_slab", VerticalSlabBlock::new, AbstractBlock.Settings.create()); + + public static final BlockFamily RUBY_FAMILY = new BlockFamily.Builder(RUBY_BLOCK).stairs(RUBY_STAIRS).slab(RUBY_SLAB).fence(RUBY_FENCE).build(); + // :::1 public static Block register(Block block, RegistryKey blockKey, boolean shouldRegisterItem) { // Sometimes, you may not want to register an item for the block. @@ -101,6 +147,26 @@ public static Block register(Block block, RegistryKey blockKey, boolean s } // :::1 + + /** Helper methods for registering blocks (Fellteros).
+ * Block would look like this: + *
+	 *     public static final Block TEST = registerBlock("test", Block::new, AbstractBlock.Settings.create());
+	 * 
+ * */ + private static Block registerBlock(String name, @NotNull Function function, AbstractBlock.@NotNull Settings settings) { + Block block = function.apply(settings.registryKey(keyOfBlock(name))); + Registry.register(Registries.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name), new BlockItem(block, new Item.Settings().useBlockPrefixedTranslationKey().registryKey(keyOfItem(name)))); + return Registry.register(Registries.BLOCK, keyOfBlock(name), block); + } + private static RegistryKey keyOfItem(String name) { + return RegistryKey.of(RegistryKeys.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name)); + } + private static RegistryKey keyOfBlock(String name) { + return RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(FabricDocsReference.MOD_ID, name)); + } + + public static void initialize() { setupItemGroups(); } @@ -117,6 +183,13 @@ public static void setupItemGroups() { itemGroup.add(ModBlocks.PRISMARINE_LAMP.asItem()); itemGroup.add(ModBlocks.COUNTER_BLOCK.asItem()); itemGroup.add(ModBlocks.ENGINE_BLOCK.asItem()); + itemGroup.add(RUBY_BLOCK); + itemGroup.add(RUBY_STAIRS); + itemGroup.add(RUBY_SLAB); + itemGroup.add(RUBY_FENCE); + itemGroup.add(RUBY_DOOR); + itemGroup.add(RUBY_TRAPDOOR); + itemGroup.add(VERTICAL_OAK_LOG_SLAB); }); } From deeef7cf815fedcf9a28c27aff5f0a56445066c6 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:58:51 +0100 Subject: [PATCH 17/41] Put all textures into one atlas --- .../data-generation/block-model/atlas.png | Bin 0 -> 1304 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/assets/develop/data-generation/block-model/atlas.png diff --git a/public/assets/develop/data-generation/block-model/atlas.png b/public/assets/develop/data-generation/block-model/atlas.png new file mode 100644 index 0000000000000000000000000000000000000000..40aa60c229ed80a13bfceae8946c2c406c294473 GIT binary patch literal 1304 zcmV+z1?T#SP)Px((n&-?RA_0bp4c0KHxhfQN?%1ifBQ&0Cg*Wmy~_ACne$cX#~u=Rc|CLki?mOKUhf zI!YyXa&iK|ZuMYf?dR1EtNVNEFF@Nr2f+4R0KRtf*%+Xs*XzZ+Xjzu>8bls8aqBlm zC;bK?1st_j1fUtbQucBH*&2|f@GSUwbpyb*x28^8=DR^Vw%7Jt>cOiT{}K;O8=GEO z-QNSh!Rr2Af+vdVQ%HfbF7y2^TLbjdPYR=1y`$%ZcxQEgj|=~L=n-d-5BX2ohfvaI zV8jUB3!85^LVvZ?%}@Jb3HK}Z3J6gH8W0dg}Zjg#(%Bt<3OSNHeSW#!Ok zhfwX?_SS&N6Tc*hlPb`p>LZm!47u>HhbuDYjFrv&9)QW!Nal1e*q)0MJmXd?xS(QR zhn&0^yTKFptY>e4uGqM;X`&mn32{bFUPpBM4%TeXg>J?kFqy15KM4+fm8fQ=G3RX0 z&Gsf1R+$DN1@7~o0Jvv8wq}miTo?F$hyBuL6`VBUCqC-)|n{bnm0uFsb z3hWTl#G&lvs0Xh&^cPb8_v_Qt@~5Y#aSyoF3Y{UD>IQ9G;&s@p2HkuC=cT_8p9eTQ zI|HCpDgp5L_!#>xnNPY5V+QEN$-cUw?VsaNR7LLXti3ZP~;%uBKnWpo{L+ps2G=%7x(LXb@^Mrp`IVX zGaZWRX=;X>{AZr9(W~4QLuvT9X{au*S20uGL>lE`n8b_laZ?`P!oQ~M<%U&kFyA!3 zu$8uo6#|I~W;a}6lA*2v{>cK1Z;8mTZgjnQ(C>Pvn1>19D_lTM3y1dYX zS(QILJXB+q0}|`{>C4!hD|@+^LV7~#M(G|9H+D8<#RV*;P01zKduKL>a5I;YTAwb9!P9x^bSinjY$PQ3MO`B;(lK3O>}fOr O0000 Date: Sat, 18 Jan 2025 17:59:29 +0100 Subject: [PATCH 18/41] Completed the tutorial, added links and sources --- develop/data-generation/block-models.md | 315 ++++++++++++++++++++++++ develop/data-generation/models.md | 88 ------- 2 files changed, 315 insertions(+), 88 deletions(-) create mode 100644 develop/data-generation/block-models.md delete mode 100644 develop/data-generation/models.md diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md new file mode 100644 index 000000000..c42b90ea0 --- /dev/null +++ b/develop/data-generation/block-models.md @@ -0,0 +1,315 @@ +--- +title: Block Model Generation +description: A guide to generating block models & blockstates via datagen. +authors: + - Fellteros +--- + +# Block Model Generation {#model-generation} + +::: info PREREQUISITES +Make sure you've completed the [datagen setup](./setup) process first. +::: + +## Setup {#setup} + +First, we will need to create our ModelProvider. Create a plain Java class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. +Lastly, create constructor matching super. + +:::tip +If you're developing mods in JetBrains' Intellij Idea, you can press `Alt+Shift+Enter` while hovering over the problem to bring up a quick fix menu! +::: + +@[code lang=java transcludeWith=:::datagen-model:provider](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. + +## Blockstates and block models {#blockstates-and-block-models} + +::: info PREREQUISITES +You'll have to register the blocks, to which you want the data to be generated. Also see the [blockstate](../blocks/blockstates.md) and [first block](../blocks/first-block.md) tutorials. +::: + +```java +@Override +public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { +} +``` + +This part of the tutorial will happen entirely in the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this class will be responsible for generating all the JSON files. +Here are some handy examples you can use to generate your desired models: + +### Simple Cube All {#simple-cube-all} + +@[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. It provides the same texture (named `steel_block`) for all six sides. + +```json +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/steel_block" + } +} +``` + +It also generates a blockstate JSON file. Since we have no blockstates (e.g. Axis, Facing, ...), one variant is sufficient, and is used everytime the block is placed. + +```json +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/steel_block" + } + } +} +``` + +### Singletons {#singletons} + +The `registerSingleton` method provides JSON model files based on the `TexturedModel` you pass in and a single blockstate variant. For example + +@[code lang=java transcludeWith=:::datagen-model:cube-top-for-ends](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +will generate models for a normal cube, that uses a PNG file `pipe_block` for the sides and a PNG file `pipe_block_top` for the top and bottom sides. + +```json +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "fabric-docs-reference:block/pipe_block_top", + "side": "fabric-docs-reference:block/pipe_block" + } +} +``` + +:::tip +If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the `TextureMaps`! +::: + +### Block Texture Pool {#block-texture-pool} + +@[code lang=java transcludeWith=:::datagen-model:block-texture-pool-normal](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures.
+In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. +***It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure the texture provision!***
+ +You can also append a `BlockFamily`, which will generate models for all of its "children". + +@[code lang=java transcludeWith=:::datagen-model:block-texture-pool-family](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + + + +::: warning +Make sure you're using the correct Block class when passing in the block! +For example, in the `.stairs()` method, you have to pass in an instance of StairsBlock; in `.slab()`, it has to be an instance of SlabBlock and so on! +::: + +### Doors and Trapdoors {#doors-and-trapdoors} + +@[code lang=java transcludeWith=:::datagen-model:door-and-trapdoor](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Doors and trapdoors are a little different. Here, you have to make three new textures - two for the door, and one for the trapdoor.
+ +1. **The door**. It has two parts - the upper half and the lower half. **Each needs its own texture:** in this case `ruby_door_top` for the upper half and `ruby_door_bottom` for the lower. +8 new model JSONs should be created.
+**You also need an item texture!** Put it in `assets//textures/item/` folder. +2. **The trapdoor**. Here, you need only one texture, in this case named `ruby_trapdoor`. It will be used for all sides. +Since `TrapdoorBlock` has a `FACING` property, you can use the commented out method to generate model files with rotated textures = the trapdoor will be "orientable". +Otherwise, it will look the same no matter the facing. + +::: warning +Again, make sure the door and trapdoor blocks are instances of their corresponding block classes (`DoorBlock`, `TrapdoorBlock`)! +::: + +## Custom Block Models and Datagen Methods {#custom-models-and-methods} + +In this tutorial, we will be creating a method, that will generate block models and blockstate for a custom block.
+In this case it will be a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. + +::: info THINGS WE WILL NEED +1. [Custom Block Class](#custom-block-class) +2. [Parent Block Model](#parent-block-model) +3. [Custom Model](#custom-model) +4. [Using Texture Map](#using-texture-map) +5. [Custom BlockStateSupplier Method](#custom-supplier-method) +6. [Custom Datagen Method](#custom-datagen-method) +::: + +### Custom Block Class {#custom-block-class} + +First, create a plain Java class that `extends Block`. Then create constructor matching super. + +@[code lang=java transcludeWith=:::datagen-model-custom:constructor](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Next, create two properties: +1. `BooleanProperty` SINGLE, indicating if the vertical slab is single or not. +2. `EnumProperty` FACING, providing a direction in which the block is facing. + +@[code lang=java transcludeWith=:::datagen-model-custom:properties](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Determine four `VoxelShape`s, one for each direction, as VoxelShapes cannot be rotated. + +@[code lang=java transcludeWith=:::datagen-model-custom:voxels](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Override the `getSidesShape()` method to determine the voxel shape used. Use switch statement and pass in the `direction` variable. +Then call this method in the `getCollisionShape()` & `getOutlineShape()` methods. + +@[code lang=java transcludeWith=:::datagen-model-custom:collision](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Override the `canReplace()` method, otherwise you couldn't make the slab a full block. + +@[code lang=java transcludeWith=:::datagen-model-custom:replace](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Override the `getPlacementState()` method to determine placement blockstate. + +@[code lang=java transcludeWith=:::datagen-model-custom:placement](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +Lastly, override the `appendProperties()` method and add both properties to the builder. + +@[code lang=java transcludeWith=:::datagen-model-custom:append](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +And you're done! You can now create a vertical slab block and place it in the game! + +### Parent Block Model {#parent-block-model} + +Now, let's create a parent block model. It will determine the size, position in hand or other slots and the `x` and `y` coordinates of the texture. +I highly recommend using [Blockbench](https://www.blockbench.net/) for this, as making it manually is a really tedious process. It should look something like this: + +```json +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "display": { + "gui": { + "rotation": [ 30, -135, 0 ], + "translation": [ -1.5, 0.75, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "firstperson_righthand": { + "rotation": [ 0, -45, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 315, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, -45, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_lefthand": { + "rotation": [ 75, 315, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + } + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 8 ], + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#bottom", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 8, 16 ], "texture": "#side", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#side", "cullface": "east", "tintindex": 0 } + } + } + ] +} +``` + +See [how blockstates are formatted](https://minecraft.wiki/w/Blockstates_definition_format) for more information.
+Notice the `#bottom`, `#top`, `#side` keywords. They act as a kind of "placeholders", that will get replaced by `Identifier`s in the generated JSON file. +Something like in sandstone's model file: +```json +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:block/sandstone_bottom", + "side": "minecraft:block/sandstone", + "top": "minecraft:block/sandstone_top" + } +} +``` + +`#bottom` gets "replaced" by the `"bottom"` and so on. **Put it in the `resources/assets//models/block/` folder.** + +### Custom Model {#custom-model} + +Another thing we will need is an instance of the `Model` class. It will represent the actual [parent block model](#parent-block-model) inside our mod. + +@[code lang=java transcludeWith=:::datagen-model-custom:model](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +The `block()` method creates a new `Model`, pointing to the `vertical_slab.json` file inside the `resources/assets//models/block/` folder. +The `TextureKey`s represent the "placeholders" (`#bottom`, `#top`, ...) as an Object. + +### Using Texture Map {#using-texture-map} + +What does `TextureMap` do? It actually provides the Identifiers that point to the textures. It technically behaves like a normal map - you associate a `TextureKey` (Key) with an `Identifier` (Value). +You can: +1. Use the Vanilla ones, e.g. `TextureMap.all()`(associates all TextureKeys with the same Identifier) or other. +2. Create a new one by creating a new instance and then using `.put()` to associate keys with values. + +::: tip +`TextureMap.all()` associates all TextureKeys with the same Identifier, no matter how many of them there are! +::: + +Since we want to use the Oak Log textures, but have the ``BOTTOM``, ``TOP`` and ``SIDE`` ``TextureKey``s, we need to create a new one. + +@[code lang=java transcludeWith=:::datagen-model-custom:texture-map](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +=> the ``bottom`` and ``top`` faces will use `oak_log_top.png`, the sides will use `oak_log.png`. + +::: warning +All `TextureKey`s in the TextureMap **have to** match all `TextureKey`s in your parent block model! +::: + +### Custom BlockStateSupplier Method {#custom-supplier-method} + +The `BlockStateSupplier` contains all blockstate variants, their rotation, and other options like uvlock. + +@[code lang=java transcludeWith=:::datagen-model-custom:supplier](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +First, we create a new `VariantsBlockStateSupplier` using `.create()`. Then append `.coordinate()`, in which create a new `BlockStateVariantMap`. Here, pass in all of our properties - in this case `FACING` & `SINGLE`. +Specify which model and which transformations (uvlock, rotation) is used when using `.register()`.
+For example: +* On the first line, the block is facing north, and is single => we use the model with no rotation. +* On the fourth line, the block is facing west, and is single => we rotate the model on the Y axis by 270°. +* On the sixth line, the block is facing east, but isn't single => it looks like a normal oak log => we don't have to rotate it. + +### Custom Datagen Method {#custom-datagen-method} + +The last step - creating an actual method you can call and that will generate the JSONs. +But what are the parameters for? +1. `BlockStateModelGenerator bsmg` is used for its variables. **Creating new ones won't work!** +2. `Block vertSlabBlock` is the block to which we will generate the JSONs. +3. `Block fullBlock` - is the model used when the `SINGLE` property is false = the slab block looks like a full block. +4. `TextureMap textures` defines the actual textures the model uses. See the [Using Texture Map](#using-texture-map) chapter. + +@[code lang=java transcludeWith=:::datagen-model-custom:gen](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +Let's go over line by line to really understand what is going on: +1. Here we obtain the `Identifier` representing the vertical slab model via the `.upload()` method. We will pass in our [TextureMap](#using-texture-map) when calling this method. +2. Here we obtain the `Identifier` of the full block - in our case of Oak Log. +3. Here the `Consumer blockStateCollector` is called, accepting all of our blockstate variants. +4. Here we register an item model for the vertical slab. + +And that is all! Now all that's left to do is to call our method in our `ModelProvider`: + +@[code lang=java transcludeWith=:::datagen-model-custom:method-call](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +## Sources and links {#sources-and-links} + +Other examples of implementing custom datagen methods can be found [here](https://github.com/Fellteros/vanillablocksplus) and [here](https://github.com/Fellteros/vanillavsplus) +Textures, free to download: +Atlas of all textures + diff --git a/develop/data-generation/models.md b/develop/data-generation/models.md deleted file mode 100644 index 9856111ba..000000000 --- a/develop/data-generation/models.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: Model Generation -description: A guide to generating models, item models and blockstates via datagen -authors: - - Fellteros ---- - -# Model Generation {#model-generation} - -::: info PREREQUISITES -Make sure you've completed the [datagen setup](./setup) process first. -::: - -## Setup {#setup} - -First, we will need to create our ModelProvider. Create a plain Java class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. -Lastly, create constructor matching super. - -:::tip -If you're developing mods in JetBrains' Intellij Idea, you can press `Alt+Shift+Enter` while hovering over the problem to bring up a quick fix menu! -::: - -@[code lang=java transcludeWith=:::datagen-model:provider](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) - -Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. - -## Blockstates and block models {#blockstates-and-block-models} - -::: info PREREQUISITES -You'll have to register the blocks, to which you want the data to be generated. Also see the blockstate and first block tutorials. -::: - -This part of the tutorial will happen entirely in the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this class will be responsible for generating all the JSON files. -Here are some handy examples you can use to generate your desired models: - -### Simple Cube All {#simple-cube-all} - -@[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) - -The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. It provides the same texture (named `steel_block`) for all six sides. - -```json -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "fabric-docs-reference:block/steel_block" - } -} -``` - -It also generates a blockstate JSON file. Since we have no blockstates (e.g. Axis, Facing, ...), one variant is sufficient, and is used everytime the block is placed. - -```json -{ - "variants": { - "": { - "model": "fabric-docs-reference:block/steel_block" - } - } -} -``` - -### Singletons {#singletons} - -The `registerSingleton` method provides JSON model files based on the `TexturedModel` you pass in and a single blockstate variant. For example - -@[code lang=java transcludeWith=:::datagen-model:cube-top-for-ends](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) - -will generate models for a normal cube, that uses a PNG file `pipe_block_side` for the sides and a PNG file `pipe_block_top` for the top and bottom sides. - -:::tip -If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the `TextureMaps`! -::: - -### Block Texture Pool {#block-texture-pool} - -@[code lang=java transcludeWith=:::datagen-model:block-texture-pool](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) - -Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures.
-In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. -***It will also generate a [simple cube all JSON model](#simple-cube-all-simple-cube-all) for the "base block" to ensure the texture provision!*** - -::: warning -Make sure you're using the correct Block class when passing in the block! -For example, in the `.stairs()` method, you have to pass in an instance of StairsBlock; in `.slab()`, it has to be an instance of SlabBlock and so on! -::: - - From 9e08adbacaaf6f60e47b3d2d45b0f62baa4b7453 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 17:59:57 +0100 Subject: [PATCH 19/41] Added translations for all blocks from Block Model Generation --- .../assets/fabric-docs-reference/lang/en_us.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/lang/en_us.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/lang/en_us.json index 46e48bef6..dd0a7e484 100644 --- a/reference/latest/src/main/generated/assets/fabric-docs-reference/lang/en_us.json +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/lang/en_us.json @@ -3,7 +3,16 @@ "block.fabric-docs-reference.condensed_oak_log": "Condensed Oak Log", "block.fabric-docs-reference.counter_block": "Counter Block", "block.fabric-docs-reference.engine": "Engine Block", + "block.fabric-docs-reference.pipe_block": "Pipe Block", "block.fabric-docs-reference.prismarine_lamp": "Prismarine Lamp", + "block.fabric-docs-reference.ruby_block": "Ruby Block", + "block.fabric-docs-reference.ruby_door": "Ruby Door", + "block.fabric-docs-reference.ruby_fence": "Ruby Fence", + "block.fabric-docs-reference.ruby_slab": "Ruby Slab", + "block.fabric-docs-reference.ruby_stairs": "Ruby Stairs", + "block.fabric-docs-reference.ruby_trapdoor": "Ruby Trapdoor", + "block.fabric-docs-reference.steel_block": "Steel Block", + "block.fabric-docs-reference.vertical_oak_log_slab": "Vertical Oak Log Slab", "death.attack.tater": "%1$s died from Tater damage!", "effect.fabric-docs-reference.tater": "Tater", "enchantment.fabric-docs-reference.thundering": "Thundering", From 2af0474a4282b58a7bdb125a5435229cd484f010 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 18:00:27 +0100 Subject: [PATCH 20/41] Added translations for block-models.md and item-models.md --- sidebar_translations.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sidebar_translations.json b/sidebar_translations.json index 9ecb78ba5..a8ef62891 100644 --- a/sidebar_translations.json +++ b/sidebar_translations.json @@ -49,7 +49,8 @@ "develop.dataGeneration.advancements": "Advancement Generation", "develop.dataGeneration.recipes": "Recipe Generation", "develop.dataGeneration.lootTables": "Loot Table Generation", - "develop.dataGeneration.models": "Model Generation", + "develop.dataGeneration.blockModels": "Block Model Generation", + "develop.dataGeneration.itemModels": "Item Model Generation", "develop.rendering": "Rendering", "develop.rendering.basicConcepts": "Basic Rendering Concepts", "develop.rendering.drawContext": "Using the Drawing Context", From abb2c06deeea83e30ef9b3816fbd309ac488dcf7 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 18:00:58 +0100 Subject: [PATCH 21/41] Created an example block for the custom datagen method implementation --- .../docs/block/custom/VerticalSlabBlock.java | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java diff --git a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java new file mode 100644 index 000000000..c3a4a9c77 --- /dev/null +++ b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java @@ -0,0 +1,135 @@ +package com.example.docs.block.custom; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.ShapeContext; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.state.property.Properties; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; +import net.minecraft.world.WorldView; +import net.minecraft.world.tick.ScheduledTickView; + +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +// :::datagen-model-custom:constructor +public class VerticalSlabBlock extends Block { + // :::datagen-model-custom:constructor + + // :::datagen-model-custom:properties + public static final BooleanProperty SINGLE = BooleanProperty.of("single"); + public static final EnumProperty FACING = Properties.HORIZONTAL_FACING; + // :::datagen-model-custom:properties + // :::datagen-model-custom:voxels + public static final VoxelShape NORTH_SHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 16.0, 8.0); + public static final VoxelShape SOUTH_SHAPE = Block.createCuboidShape(0.0, 0.0, 8.0, 16.0, 16.0, 16.0); + public static final VoxelShape WEST_SHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 8.0, 16.0, 16.0); + public static final VoxelShape EAST_SHAPE = Block.createCuboidShape(8.0, 0.0, 0.0, 16.0, 16.0, 16.0); + // :::datagen-model-custom:voxels + + // :::datagen-model-custom:constructor + public VerticalSlabBlock(Settings settings) { + super(settings); + } + // :::datagen-model-custom:constructor + + // :::datagen-model-custom:collision + @Override + protected VoxelShape getSidesShape(BlockState state, BlockView world, BlockPos pos) { + boolean type = state.get(SINGLE); + Direction direction = state.get(FACING); + VoxelShape voxelShape; + if (type) { + switch (direction) { + case WEST -> voxelShape = WEST_SHAPE.asCuboid(); + case EAST -> voxelShape = EAST_SHAPE.asCuboid(); + case SOUTH -> voxelShape = SOUTH_SHAPE.asCuboid(); + case NORTH -> voxelShape = NORTH_SHAPE.asCuboid(); + default -> throw new MatchException(null, null); + } + return voxelShape; + } else { + return VoxelShapes.fullCube(); + } + } + + @Override + protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return this.getSidesShape(state, world, pos); + } + + @Override + protected VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { + return this.getSidesShape(state, world, pos); + } + // :::datagen-model-custom:collision + + // :::datagen-model-custom:replace + @Override + protected boolean canReplace(BlockState state, ItemPlacementContext context) { + Direction direction = state.get(FACING); + if (context.getStack().isOf(this.asItem()) && state.get(SINGLE)) { + if (context.canReplaceExisting()) { + return context.getSide().getOpposite() == direction; + } + } + return false; + } + // :::datagen-model-custom:replace + + + // :::datagen-model-custom:placement + @Override + @Nullable + public BlockState getPlacementState(ItemPlacementContext ctx) { + BlockPos pos = ctx.getBlockPos(); + Direction direction = ctx.getHorizontalPlayerFacing(); + BlockState state = ctx.getWorld().getBlockState(pos); + BlockState state2 = Objects.requireNonNull(super.getPlacementState(ctx)); + + if (state.isOf(this) && state.get(FACING) == ctx.getSide().getOpposite()) { + return state.isOf(this) ? state2.with(SINGLE, false) : super.getPlacementState(ctx); + } + + if (direction == Direction.NORTH && ctx.getHitPos().z - pos.getZ() > 0.5) { + return state2.with(FACING, Direction.SOUTH).with(SINGLE, true); + } else if (direction == Direction.SOUTH && ctx.getHitPos().z - pos.getZ() < 0.5) { + return state2.with(FACING, Direction.NORTH).with(SINGLE, true); + } else if (direction == Direction.WEST && ctx.getHitPos().x - pos.getX() > 0.5) { + return state2.with(FACING, Direction.EAST).with(SINGLE, true); + } else if (direction == Direction.EAST && ctx.getHitPos().x - pos.getX() < 0.5) { + return state2.with(FACING, Direction.WEST).with(SINGLE, true); + } else { + return state2.with(FACING, direction); + } + } + + // :::datagen-model-custom:placement + + // :::datagen-model-custom:append + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(SINGLE, FACING); + } + // :::datagen-model-custom:append + + @Override + protected BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) { + if (!state.canPlaceAt(world, pos)) { + return Blocks.AIR.getDefaultState(); + } + return super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random); + } + // :::datagen-model-custom:constructor +} +// :::datagen-model-custom:constructor From 3748daa3b3cd294b0400f85f8d4eb0d239884ab5 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 18:01:47 +0100 Subject: [PATCH 22/41] blockstates, block models and item models of all blocks from Block Model Generation tutorial --- .../blockstates/pipe_block.json | 7 + .../blockstates/ruby_block.json | 7 + .../blockstates/ruby_door.json | 124 +++++++++++ .../blockstates/ruby_fence.json | 48 ++++ .../blockstates/ruby_slab.json | 13 ++ .../blockstates/ruby_stairs.json | 209 ++++++++++++++++++ .../blockstates/ruby_trapdoor.json | 58 +++++ .../blockstates/steel_block.json | 7 + .../blockstates/vertical_oak_log_slab.json | 39 ++++ .../items/pipe_block.json | 6 + .../items/ruby_block.json | 6 + .../items/ruby_door.json | 6 + .../items/ruby_fence.json | 6 + .../items/ruby_slab.json | 6 + .../items/ruby_stairs.json | 6 + .../items/ruby_trapdoor.json | 6 + .../items/steel_block.json | 6 + .../items/vertical_oak_log_slab.json | 6 + .../models/block/pipe_block.json | 7 + .../models/block/ruby_block.json | 6 + .../models/block/ruby_door_bottom_left.json | 7 + .../block/ruby_door_bottom_left_open.json | 7 + .../models/block/ruby_door_bottom_right.json | 7 + .../block/ruby_door_bottom_right_open.json | 7 + .../models/block/ruby_door_top_left.json | 7 + .../models/block/ruby_door_top_left_open.json | 7 + .../models/block/ruby_door_top_right.json | 7 + .../block/ruby_door_top_right_open.json | 7 + .../models/block/ruby_fence_inventory.json | 6 + .../models/block/ruby_fence_post.json | 6 + .../models/block/ruby_fence_side.json | 6 + .../models/block/ruby_slab.json | 8 + .../models/block/ruby_slab_top.json | 8 + .../models/block/ruby_stairs.json | 8 + .../models/block/ruby_stairs_inner.json | 8 + .../models/block/ruby_stairs_outer.json | 8 + .../models/block/ruby_trapdoor_bottom.json | 6 + .../models/block/ruby_trapdoor_open.json | 6 + .../models/block/ruby_trapdoor_top.json | 6 + .../models/block/steel_block.json | 6 + .../models/block/vertical_oak_log_slab.json | 8 + .../models/item/ruby_door.json | 6 + .../models/block/vertical_slab.json | 46 ++++ 43 files changed, 777 insertions(+) create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json new file mode 100644 index 000000000..e7ad78017 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/pipe_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json new file mode 100644 index 000000000..71f5964d5 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/ruby_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json new file mode 100644 index 000000000..7134d5ea4 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json @@ -0,0 +1,124 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left" + }, + "facing=east,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 90 + }, + "facing=east,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right" + }, + "facing=east,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 270 + }, + "facing=east,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left" + }, + "facing=east,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 90 + }, + "facing=east,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right" + }, + "facing=east,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open" + }, + "facing=north,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 270 + }, + "facing=north,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 180 + }, + "facing=north,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 270 + }, + "facing=north,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open" + }, + "facing=north,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 270 + }, + "facing=north,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 180 + }, + "facing=south,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 90 + }, + "facing=south,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 180 + }, + "facing=south,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 90 + }, + "facing=south,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open" + }, + "facing=south,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 90 + }, + "facing=south,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 180 + }, + "facing=south,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 90 + }, + "facing=south,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open" + }, + "facing=west,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 180 + }, + "facing=west,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 270 + }, + "facing=west,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 180 + }, + "facing=west,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 90 + }, + "facing=west,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 180 + }, + "facing=west,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 270 + }, + "facing=west,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 180 + }, + "facing=west,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 90 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json new file mode 100644 index 000000000..def805c17 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json @@ -0,0 +1,48 @@ +{ + "multipart": [ + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_post" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true + }, + "when": { + "north": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 90 + }, + "when": { + "east": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 180 + }, + "when": { + "south": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 270 + }, + "when": { + "west": "true" + } + } + ] +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json new file mode 100644 index 000000000..d8016c008 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json @@ -0,0 +1,13 @@ +{ + "variants": { + "type=bottom": { + "model": "fabric-docs-reference:block/ruby_slab" + }, + "type=double": { + "model": "fabric-docs-reference:block/ruby_block" + }, + "type=top": { + "model": "fabric-docs-reference:block/ruby_slab_top" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json new file mode 100644 index 000000000..64c956105 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json @@ -0,0 +1,209 @@ +{ + "variants": { + "facing=east,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner" + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer" + }, + "facing=east,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs" + }, + "facing=east,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner" + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer" + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 180 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json new file mode 100644 index 000000000..d183fe96b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json @@ -0,0 +1,58 @@ +{ + "variants": { + "facing=east,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=east,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 90 + }, + "facing=east,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=east,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 90 + }, + "facing=north,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=north,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open" + }, + "facing=north,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=north,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open" + }, + "facing=south,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=south,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 180 + }, + "facing=south,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=south,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 180 + }, + "facing=west,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=west,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 270 + }, + "facing=west,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=west,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 270 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json new file mode 100644 index 000000000..13013a2ea --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/steel_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json new file mode 100644 index 000000000..d8593048d --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json @@ -0,0 +1,39 @@ +{ + "variants": { + "facing=east,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=east,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 90 + }, + "facing=north,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=north,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true + }, + "facing=south,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=south,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 180 + }, + "facing=west,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=west,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 270 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json new file mode 100644 index 000000000..ac16ef413 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/pipe_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json new file mode 100644 index 000000000..2d7e26edb --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json new file mode 100644 index 000000000..07d2240a9 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:item/ruby_door" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json new file mode 100644 index 000000000..aee82d9ad --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_fence_inventory" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json new file mode 100644 index 000000000..bd003b663 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_slab" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json new file mode 100644 index 000000000..8918ad9b2 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_stairs" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json new file mode 100644 index 000000000..620b00ddb --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json new file mode 100644 index 000000000..f369f13fc --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/steel_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json new file mode 100644 index 000000000..22a242a3b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/vertical_oak_log_slab" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json new file mode 100644 index 000000000..5623b345d --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "fabric-docs-reference:block/pipe_block_top", + "side": "fabric-docs-reference:block/pipe_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json new file mode 100644 index 000000000..fafc5cf4c --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json new file mode 100644 index 000000000..14eab585c --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_left", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json new file mode 100644 index 000000000..47b9dbbc0 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_left_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json new file mode 100644 index 000000000..f16646302 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_right", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json new file mode 100644 index 000000000..04c7c3dad --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_right_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json new file mode 100644 index 000000000..19ff9c361 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_left", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json new file mode 100644 index 000000000..1027e14b4 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_left_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json new file mode 100644 index 000000000..6c2127114 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_right", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json new file mode 100644 index 000000000..b950fb298 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_right_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json new file mode 100644 index 000000000..e48eedc6b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json new file mode 100644 index 000000000..c12a70ec2 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_post", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json new file mode 100644 index 000000000..42f4d0e69 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_side", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json new file mode 100644 index 000000000..9fb9d213e --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json new file mode 100644 index 000000000..f1d1c9591 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab_top", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json new file mode 100644 index 000000000..556b498d3 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json new file mode 100644 index 000000000..5c187826a --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/inner_stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json new file mode 100644 index 000000000..9212dfeba --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/outer_stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json new file mode 100644 index 000000000..7c184bec6 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_bottom", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json new file mode 100644 index 000000000..a6aa488d3 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_open", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json new file mode 100644 index 000000000..295dddbf0 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_top", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json new file mode 100644 index 000000000..4c8b1a76e --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/steel_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json new file mode 100644 index 000000000..021f64564 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "fabric-docs-reference:block/vertical_slab", + "textures": { + "bottom": "minecraft:block/oak_log_top", + "side": "minecraft:block/oak_log", + "top": "minecraft:block/oak_log_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json new file mode 100644 index 000000000..9ed308b23 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "fabric-docs-reference:item/ruby_door" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json b/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json new file mode 100644 index 000000000..91c85e2aa --- /dev/null +++ b/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "display": { + "gui": { + "rotation": [ 30, -135, 0 ], + "translation": [ -1.5, 0.75, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "firstperson_righthand": { + "rotation": [ 0, -45, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 315, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, -45, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_lefthand": { + "rotation": [ 75, 315, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + } + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 8 ], + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#bottom", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 8, 16 ], "texture": "#side", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#side", "cullface": "east", "tintindex": 0 } + } + } + ] +} \ No newline at end of file From 1b9928fb7addd70296e7e92084e2701f5d9ec7de Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sat, 18 Jan 2025 18:01:47 +0100 Subject: [PATCH 23/41] blockstates, block models and item models of all blocks from Block Model Generation tutorial + package-lock.json --- package-lock.json | 1 + .../blockstates/pipe_block.json | 7 + .../blockstates/ruby_block.json | 7 + .../blockstates/ruby_door.json | 124 +++++++++++ .../blockstates/ruby_fence.json | 48 ++++ .../blockstates/ruby_slab.json | 13 ++ .../blockstates/ruby_stairs.json | 209 ++++++++++++++++++ .../blockstates/ruby_trapdoor.json | 58 +++++ .../blockstates/steel_block.json | 7 + .../blockstates/vertical_oak_log_slab.json | 39 ++++ .../items/pipe_block.json | 6 + .../items/ruby_block.json | 6 + .../items/ruby_door.json | 6 + .../items/ruby_fence.json | 6 + .../items/ruby_slab.json | 6 + .../items/ruby_stairs.json | 6 + .../items/ruby_trapdoor.json | 6 + .../items/steel_block.json | 6 + .../items/vertical_oak_log_slab.json | 6 + .../models/block/pipe_block.json | 7 + .../models/block/ruby_block.json | 6 + .../models/block/ruby_door_bottom_left.json | 7 + .../block/ruby_door_bottom_left_open.json | 7 + .../models/block/ruby_door_bottom_right.json | 7 + .../block/ruby_door_bottom_right_open.json | 7 + .../models/block/ruby_door_top_left.json | 7 + .../models/block/ruby_door_top_left_open.json | 7 + .../models/block/ruby_door_top_right.json | 7 + .../block/ruby_door_top_right_open.json | 7 + .../models/block/ruby_fence_inventory.json | 6 + .../models/block/ruby_fence_post.json | 6 + .../models/block/ruby_fence_side.json | 6 + .../models/block/ruby_slab.json | 8 + .../models/block/ruby_slab_top.json | 8 + .../models/block/ruby_stairs.json | 8 + .../models/block/ruby_stairs_inner.json | 8 + .../models/block/ruby_stairs_outer.json | 8 + .../models/block/ruby_trapdoor_bottom.json | 6 + .../models/block/ruby_trapdoor_open.json | 6 + .../models/block/ruby_trapdoor_top.json | 6 + .../models/block/steel_block.json | 6 + .../models/block/vertical_oak_log_slab.json | 8 + .../models/item/ruby_door.json | 6 + .../models/block/vertical_slab.json | 46 ++++ 44 files changed, 778 insertions(+) create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json create mode 100644 reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json diff --git a/package-lock.json b/package-lock.json index e34ca95a3..fcbb9f438 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2439,6 +2439,7 @@ "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.35.0.tgz", "integrity": "sha512-wgp8yesWjFBL7bycA3hxwHRdsZGJhjhyP1dSxKVKrza0EPFYtn+mHtkVy6dvP1kGSjovyG5B8yNP6Frj0UFUJg==", "dev": true, + "license": "MIT", "dependencies": { "markdown-it": "14.1.0", "markdownlint-micromark": "0.1.10" diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json new file mode 100644 index 000000000..e7ad78017 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/pipe_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/pipe_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json new file mode 100644 index 000000000..71f5964d5 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/ruby_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json new file mode 100644 index 000000000..7134d5ea4 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_door.json @@ -0,0 +1,124 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left" + }, + "facing=east,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 90 + }, + "facing=east,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right" + }, + "facing=east,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 270 + }, + "facing=east,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left" + }, + "facing=east,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 90 + }, + "facing=east,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right" + }, + "facing=east,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open" + }, + "facing=north,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 270 + }, + "facing=north,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 180 + }, + "facing=north,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 270 + }, + "facing=north,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open" + }, + "facing=north,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 270 + }, + "facing=north,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 180 + }, + "facing=south,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 90 + }, + "facing=south,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 180 + }, + "facing=south,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 90 + }, + "facing=south,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open" + }, + "facing=south,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 90 + }, + "facing=south,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 180 + }, + "facing=south,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 90 + }, + "facing=south,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open" + }, + "facing=west,half=lower,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left", + "y": 180 + }, + "facing=west,half=lower,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_left_open", + "y": 270 + }, + "facing=west,half=lower,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right", + "y": 180 + }, + "facing=west,half=lower,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_bottom_right_open", + "y": 90 + }, + "facing=west,half=upper,hinge=left,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_left", + "y": 180 + }, + "facing=west,half=upper,hinge=left,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_left_open", + "y": 270 + }, + "facing=west,half=upper,hinge=right,open=false": { + "model": "fabric-docs-reference:block/ruby_door_top_right", + "y": 180 + }, + "facing=west,half=upper,hinge=right,open=true": { + "model": "fabric-docs-reference:block/ruby_door_top_right_open", + "y": 90 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json new file mode 100644 index 000000000..def805c17 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_fence.json @@ -0,0 +1,48 @@ +{ + "multipart": [ + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_post" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true + }, + "when": { + "north": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 90 + }, + "when": { + "east": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 180 + }, + "when": { + "south": "true" + } + }, + { + "apply": { + "model": "fabric-docs-reference:block/ruby_fence_side", + "uvlock": true, + "y": 270 + }, + "when": { + "west": "true" + } + } + ] +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json new file mode 100644 index 000000000..d8016c008 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_slab.json @@ -0,0 +1,13 @@ +{ + "variants": { + "type=bottom": { + "model": "fabric-docs-reference:block/ruby_slab" + }, + "type=double": { + "model": "fabric-docs-reference:block/ruby_block" + }, + "type=top": { + "model": "fabric-docs-reference:block/ruby_slab_top" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json new file mode 100644 index 000000000..64c956105 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_stairs.json @@ -0,0 +1,209 @@ +{ + "variants": { + "facing=east,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner" + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer" + }, + "facing=east,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs" + }, + "facing=east,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner" + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer" + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=top,shape=inner_left": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=inner_right": { + "model": "fabric-docs-reference:block/ruby_stairs_inner", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=outer_left": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=outer_right": { + "model": "fabric-docs-reference:block/ruby_stairs_outer", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=straight": { + "model": "fabric-docs-reference:block/ruby_stairs", + "uvlock": true, + "x": 180, + "y": 180 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json new file mode 100644 index 000000000..d183fe96b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/ruby_trapdoor.json @@ -0,0 +1,58 @@ +{ + "variants": { + "facing=east,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=east,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 90 + }, + "facing=east,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=east,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 90 + }, + "facing=north,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=north,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open" + }, + "facing=north,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=north,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open" + }, + "facing=south,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=south,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 180 + }, + "facing=south,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=south,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 180 + }, + "facing=west,half=bottom,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + }, + "facing=west,half=bottom,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 270 + }, + "facing=west,half=top,open=false": { + "model": "fabric-docs-reference:block/ruby_trapdoor_top" + }, + "facing=west,half=top,open=true": { + "model": "fabric-docs-reference:block/ruby_trapdoor_open", + "y": 270 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json new file mode 100644 index 000000000..13013a2ea --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "fabric-docs-reference:block/steel_block" + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json new file mode 100644 index 000000000..d8593048d --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/vertical_oak_log_slab.json @@ -0,0 +1,39 @@ +{ + "variants": { + "facing=east,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=east,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 90 + }, + "facing=north,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=north,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true + }, + "facing=south,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=south,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 180 + }, + "facing=west,single=false": { + "model": "minecraft:block/oak_log", + "uvlock": true + }, + "facing=west,single=true": { + "model": "fabric-docs-reference:block/vertical_oak_log_slab", + "uvlock": true, + "y": 270 + } + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json new file mode 100644 index 000000000..ac16ef413 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/pipe_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/pipe_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json new file mode 100644 index 000000000..2d7e26edb --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json new file mode 100644 index 000000000..07d2240a9 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_door.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:item/ruby_door" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json new file mode 100644 index 000000000..aee82d9ad --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_fence.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_fence_inventory" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json new file mode 100644 index 000000000..bd003b663 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_slab.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_slab" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json new file mode 100644 index 000000000..8918ad9b2 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_stairs.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_stairs" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json new file mode 100644 index 000000000..620b00ddb --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/ruby_trapdoor.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/ruby_trapdoor_bottom" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json new file mode 100644 index 000000000..f369f13fc --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/steel_block.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/steel_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json new file mode 100644 index 000000000..22a242a3b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/items/vertical_oak_log_slab.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "fabric-docs-reference:block/vertical_oak_log_slab" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json new file mode 100644 index 000000000..5623b345d --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "fabric-docs-reference:block/pipe_block_top", + "side": "fabric-docs-reference:block/pipe_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json new file mode 100644 index 000000000..fafc5cf4c --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json new file mode 100644 index 000000000..14eab585c --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_left", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json new file mode 100644 index 000000000..47b9dbbc0 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_left_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_left_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json new file mode 100644 index 000000000..f16646302 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_right", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json new file mode 100644 index 000000000..04c7c3dad --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_bottom_right_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_bottom_right_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json new file mode 100644 index 000000000..19ff9c361 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_left", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json new file mode 100644 index 000000000..1027e14b4 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_left_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_left_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json new file mode 100644 index 000000000..6c2127114 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_right", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json new file mode 100644 index 000000000..b950fb298 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_door_top_right_open.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/door_top_right_open", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_door_bottom", + "top": "fabric-docs-reference:block/ruby_door_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json new file mode 100644 index 000000000..e48eedc6b --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_inventory", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json new file mode 100644 index 000000000..c12a70ec2 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_post", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json new file mode 100644 index 000000000..42f4d0e69 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_fence_side.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/fence_side", + "textures": { + "texture": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json new file mode 100644 index 000000000..9fb9d213e --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json new file mode 100644 index 000000000..f1d1c9591 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_slab_top.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab_top", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json new file mode 100644 index 000000000..556b498d3 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json new file mode 100644 index 000000000..5c187826a --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/inner_stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json new file mode 100644 index 000000000..9212dfeba --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/outer_stairs", + "textures": { + "bottom": "fabric-docs-reference:block/ruby_block", + "side": "fabric-docs-reference:block/ruby_block", + "top": "fabric-docs-reference:block/ruby_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json new file mode 100644 index 000000000..7c184bec6 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_bottom", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json new file mode 100644 index 000000000..a6aa488d3 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_open", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json new file mode 100644 index 000000000..295dddbf0 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/ruby_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_trapdoor_top", + "textures": { + "texture": "fabric-docs-reference:block/ruby_trapdoor" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json new file mode 100644 index 000000000..4c8b1a76e --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "fabric-docs-reference:block/steel_block" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json new file mode 100644 index 000000000..021f64564 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/vertical_oak_log_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "fabric-docs-reference:block/vertical_slab", + "textures": { + "bottom": "minecraft:block/oak_log_top", + "side": "minecraft:block/oak_log", + "top": "minecraft:block/oak_log_top" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json new file mode 100644 index 000000000..9ed308b23 --- /dev/null +++ b/reference/latest/src/main/generated/assets/fabric-docs-reference/models/item/ruby_door.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "fabric-docs-reference:item/ruby_door" + } +} \ No newline at end of file diff --git a/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json b/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json new file mode 100644 index 000000000..91c85e2aa --- /dev/null +++ b/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json @@ -0,0 +1,46 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#side" + }, + "display": { + "gui": { + "rotation": [ 30, -135, 0 ], + "translation": [ -1.5, 0.75, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "firstperson_righthand": { + "rotation": [ 0, -45, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "firstperson_lefthand": { + "rotation": [ 0, 315, 0 ], + "translation": [ 0, 2, 0], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_righthand": { + "rotation": [ 75, -45, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + }, + "thirdperson_lefthand": { + "rotation": [ 75, 315, 0 ], + "translation": [ 0, 0, 2], + "scale":[ 0.375, 0.375, 0.375 ] + } + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 8 ], + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#bottom", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 8, 16 ], "texture": "#side", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#side", "cullface": "east", "tintindex": 0 } + } + } + ] +} \ No newline at end of file From 1c4ffe1ea3c2c833c4337756d445b40a46aab8fc Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 10:41:27 +0100 Subject: [PATCH 24/41] Deleted item-models.md as it is redundant. --- develop/data-generation/item-models.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 develop/data-generation/item-models.md diff --git a/develop/data-generation/item-models.md b/develop/data-generation/item-models.md deleted file mode 100644 index 1941b7697..000000000 --- a/develop/data-generation/item-models.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Item Model Generation -description: A guide to generating item models and item model definitions via datagen. -authors: - - Fellteros ---- - -# Item Model Generation {#item-model-generation} - -Yet to be completed. \ No newline at end of file From 6c740c5cd46c58d2a39160d14fa55fdbd705b6ed Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 10:45:12 +0100 Subject: [PATCH 25/41] Removed item-models.md page, as it is redundant --- .vitepress/sidebars/develop.ts | 4 ---- sidebar_translations.json | 1 - 2 files changed, 5 deletions(-) diff --git a/.vitepress/sidebars/develop.ts b/.vitepress/sidebars/develop.ts index 7fd3103af..d59834b21 100644 --- a/.vitepress/sidebars/develop.ts +++ b/.vitepress/sidebars/develop.ts @@ -236,10 +236,6 @@ export default [ { text: "develop.dataGeneration.blockModels", link: "/develop/data-generation/block-models" - }, - { - text: "develop.dataGeneration.itemModels", - link: "/develop/data-generation/item-models" } ] }, diff --git a/sidebar_translations.json b/sidebar_translations.json index a8ef62891..9965a6e85 100644 --- a/sidebar_translations.json +++ b/sidebar_translations.json @@ -50,7 +50,6 @@ "develop.dataGeneration.recipes": "Recipe Generation", "develop.dataGeneration.lootTables": "Loot Table Generation", "develop.dataGeneration.blockModels": "Block Model Generation", - "develop.dataGeneration.itemModels": "Item Model Generation", "develop.rendering": "Rendering", "develop.rendering.basicConcepts": "Basic Rendering Concepts", "develop.rendering.drawContext": "Using the Drawing Context", From c49b7707fb758ab81b72b6b59066666f9c4494ef Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 11:10:24 +0100 Subject: [PATCH 26/41] Removed the getStateForNeighborUpdate method as it is redundant. --- .../com/example/docs/block/custom/VerticalSlabBlock.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java index c3a4a9c77..f7e565b27 100644 --- a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java +++ b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java @@ -123,13 +123,7 @@ protected void appendProperties(StateManager.Builder builder) } // :::datagen-model-custom:append - @Override - protected BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) { - if (!state.canPlaceAt(world, pos)) { - return Blocks.AIR.getDefaultState(); - } - return super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random); - } + // :::datagen-model-custom:constructor } // :::datagen-model-custom:constructor From 79e67514c2331f08a73bdfc9ea6500416ca38d8d Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 11:10:47 +0100 Subject: [PATCH 27/41] Removed the helper methods as they are redundant. --- .../main/java/com/example/docs/item/ModItems.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/reference/latest/src/main/java/com/example/docs/item/ModItems.java b/reference/latest/src/main/java/com/example/docs/item/ModItems.java index 0a06b4929..aa18ea6d9 100644 --- a/reference/latest/src/main/java/com/example/docs/item/ModItems.java +++ b/reference/latest/src/main/java/com/example/docs/item/ModItems.java @@ -111,18 +111,6 @@ public class ModItems { ); // :::2 - /**Helper methods for registering items (Fellteros)
- * Item registration would like this: - *
-	 *     public static final Item TEST = registerItem("test", Item::new)
-	 * 
*/ - private static Item registerItem(String name, Function function) { - return Registry.register(Registries.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name), function.apply(new Item.Settings().registryKey(keyOfItem(name)))); - } - private static RegistryKey keyOfItem(String name) { - return RegistryKey.of(RegistryKeys.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name)); - } - // :::1 public static Item register(Item item, RegistryKey registryKey) { From 2ef8bdf3db1e9cfec8a000d28fe7c0d3312963ab Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 11:10:58 +0100 Subject: [PATCH 28/41] Optimized imports --- .../1.21/src/main/java/com/example/docs/block/ModBlocks.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java index a7f93d371..de1c61733 100644 --- a/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/1.21/src/main/java/com/example/docs/block/ModBlocks.java @@ -18,10 +18,6 @@ import com.example.docs.block.custom.PrismarineLampBlock; import com.example.docs.item.ModItems; -import org.jetbrains.annotations.NotNull; - -import java.util.function.Function; - // :::1 public class ModBlocks { // :::1 From 48a7e5e1ddcbb5969f626b63d06930e65e76adb5 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 11:11:27 +0100 Subject: [PATCH 29/41] renamed Identifiers for better understanding --- .../docs/datagen/FabricDocsReferenceModelProvider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java index 0e756a6d4..fdb021bf3 100644 --- a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -141,10 +141,10 @@ private static BlockStateSupplier createVerticalSlabBlockStates(Block vertSlabBl // :::datagen-model-custom:gen public static void registerVerticalSlab(BlockStateModelGenerator bsmg, Block vertSlabBlock, Block fullBlock, TextureMap textures) { - Identifier identifier = VERTICAL_SLAB.upload(vertSlabBlock, textures, bsmg.modelCollector); - Identifier identifier2 = ModelIds.getBlockModelId(fullBlock); - bsmg.blockStateCollector.accept(createVerticalSlabBlockStates(vertSlabBlock, identifier, identifier2)); - bsmg.registerParentedItemModel(vertSlabBlock, identifier); + Identifier slabModel = VERTICAL_SLAB.upload(vertSlabBlock, textures, bsmg.modelCollector); + Identifier fullBlockModel = ModelIds.getBlockModelId(fullBlock); + bsmg.blockStateCollector.accept(createVerticalSlabBlockStates(vertSlabBlock, slabModel, fullBlockModel)); + bsmg.registerParentedItemModel(vertSlabBlock, slabModel); } // :::datagen-model-custom:gen From c52d367d4f7e4da41a3f3c23193c54060c5a9f2c Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 11:12:32 +0100 Subject: [PATCH 30/41] Made changes according to natri0's suggestions (thx a lot) --- develop/data-generation/block-models.md | 96 ++++++++----------------- 1 file changed, 28 insertions(+), 68 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index c42b90ea0..fef69d98c 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -3,6 +3,7 @@ title: Block Model Generation description: A guide to generating block models & blockstates via datagen. authors: - Fellteros + - natri0 --- # Block Model Generation {#model-generation} @@ -43,28 +44,13 @@ Here are some handy examples you can use to generate your desired models: @[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. It provides the same texture (named `steel_block`) for all six sides. +The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. One texture is used for all six sides, in this case we use `steel_block`. -```json -{ - "parent": "minecraft:block/cube_all", - "textures": { - "all": "fabric-docs-reference:block/steel_block" - } -} -``` +@[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json) It also generates a blockstate JSON file. Since we have no blockstates (e.g. Axis, Facing, ...), one variant is sufficient, and is used everytime the block is placed. -```json -{ - "variants": { - "": { - "model": "fabric-docs-reference:block/steel_block" - } - } -} -``` +@[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json) ### Singletons {#singletons} @@ -74,18 +60,10 @@ The `registerSingleton` method provides JSON model files based on the `TexturedM will generate models for a normal cube, that uses a PNG file `pipe_block` for the sides and a PNG file `pipe_block_top` for the top and bottom sides. -```json -{ - "parent": "minecraft:block/cube_column", - "textures": { - "end": "fabric-docs-reference:block/pipe_block_top", - "side": "fabric-docs-reference:block/pipe_block" - } -} -``` +@[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json) :::tip -If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the `TextureMaps`! +If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the [`TextureMaps`](#using-texture-map)! ::: ### Block Texture Pool {#block-texture-pool} @@ -94,7 +72,8 @@ If you're stuck choosing which TextureModel you should use, open the `TexturedMo Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures.
In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. -***It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure the texture provision!***
+***It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model.*** +Be aware of this, if you're changing block model of this particular block, as it will result in en error.
You can also append a `BlockFamily`, which will generate models for all of its "children". @@ -114,11 +93,11 @@ For example, in the `.stairs()` method, you have to pass in an instance of Stair Doors and trapdoors are a little different. Here, you have to make three new textures - two for the door, and one for the trapdoor.
1. **The door**. It has two parts - the upper half and the lower half. **Each needs its own texture:** in this case `ruby_door_top` for the upper half and `ruby_door_bottom` for the lower. -8 new model JSONs should be created.
+The `registerDoor()` method will create models for all orientations of the door, both open and closed.
**You also need an item texture!** Put it in `assets//textures/item/` folder. 2. **The trapdoor**. Here, you need only one texture, in this case named `ruby_trapdoor`. It will be used for all sides. Since `TrapdoorBlock` has a `FACING` property, you can use the commented out method to generate model files with rotated textures = the trapdoor will be "orientable". -Otherwise, it will look the same no matter the facing. +Otherwise, it will look the same no matter the direction it's facing. ::: warning Again, make sure the door and trapdoor blocks are instances of their corresponding block classes (`DoorBlock`, `TrapdoorBlock`)! @@ -126,8 +105,8 @@ Again, make sure the door and trapdoor blocks are instances of their correspondi ## Custom Block Models and Datagen Methods {#custom-models-and-methods} -In this tutorial, we will be creating a method, that will generate block models and blockstate for a custom block.
-In this case it will be a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. +In this tutorial we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. + ::: info THINGS WE WILL NEED 1. [Custom Block Class](#custom-block-class) @@ -138,40 +117,22 @@ In this case it will be a **vertical slab block** with Oak Log textures => _Vert 6. [Custom Datagen Method](#custom-datagen-method) ::: -### Custom Block Class {#custom-block-class} - -First, create a plain Java class that `extends Block`. Then create constructor matching super. - -@[code lang=java transcludeWith=:::datagen-model-custom:constructor](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) - -Next, create two properties: -1. `BooleanProperty` SINGLE, indicating if the vertical slab is single or not. -2. `EnumProperty` FACING, providing a direction in which the block is facing. +_Points 2. - 6. are declared in an inner static helper class called `CustomBlockStateModelGenerator`._ -@[code lang=java transcludeWith=:::datagen-model-custom:properties](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) +### Custom Block Class {#custom-block-class} -Determine four `VoxelShape`s, one for each direction, as VoxelShapes cannot be rotated. +Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there's both slabs. +Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly and the block has the correct collision shape. @[code lang=java transcludeWith=:::datagen-model-custom:voxels](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) -Override the `getSidesShape()` method to determine the voxel shape used. Use switch statement and pass in the `direction` variable. -Then call this method in the `getCollisionShape()` & `getOutlineShape()` methods. - @[code lang=java transcludeWith=:::datagen-model-custom:collision](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) -Override the `canReplace()` method, otherwise you couldn't make the slab a full block. +Also override the `canReplace()` method, otherwise you couldn't make the slab a full block. @[code lang=java transcludeWith=:::datagen-model-custom:replace](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) -Override the `getPlacementState()` method to determine placement blockstate. - -@[code lang=java transcludeWith=:::datagen-model-custom:placement](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) - -Lastly, override the `appendProperties()` method and add both properties to the builder. - -@[code lang=java transcludeWith=:::datagen-model-custom:append](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) - -And you're done! You can now create a vertical slab block and place it in the game! +And you're done! You can now test the block out and place it in game. ### Parent Block Model {#parent-block-model} @@ -228,8 +189,8 @@ I highly recommend using [Blockbench](https://www.blockbench.net/) for this, as ``` See [how blockstates are formatted](https://minecraft.wiki/w/Blockstates_definition_format) for more information.
-Notice the `#bottom`, `#top`, `#side` keywords. They act as a kind of "placeholders", that will get replaced by `Identifier`s in the generated JSON file. -Something like in sandstone's model file: +Notice the `#bottom`, `#top`, `#side` keywords. They act as variables that can be set by models that have this one as a parent: + ```json { "parent": "minecraft:block/cube_bottom_top", @@ -241,7 +202,7 @@ Something like in sandstone's model file: } ``` -`#bottom` gets "replaced" by the `"bottom"` and so on. **Put it in the `resources/assets//models/block/` folder.** +The `bottom` value will replace the `#bottom` placeholder and so on. **Put it in the `resources/assets//models/block/` folder.** ### Custom Model {#custom-model} @@ -267,7 +228,7 @@ Since we want to use the Oak Log textures, but have the ``BOTTOM``, ``TOP`` and @[code lang=java transcludeWith=:::datagen-model-custom:texture-map](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -=> the ``bottom`` and ``top`` faces will use `oak_log_top.png`, the sides will use `oak_log.png`. +The ``bottom`` and ``top`` faces will use `oak_log_top.png`, the sides will use `oak_log.png`. ::: warning All `TextureKey`s in the TextureMap **have to** match all `TextureKey`s in your parent block model! @@ -279,7 +240,8 @@ The `BlockStateSupplier` contains all blockstate variants, their rotation, and o @[code lang=java transcludeWith=:::datagen-model-custom:supplier](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -First, we create a new `VariantsBlockStateSupplier` using `.create()`. Then append `.coordinate()`, in which create a new `BlockStateVariantMap`. Here, pass in all of our properties - in this case `FACING` & `SINGLE`. +First, we create a new `VariantsBlockStateSupplier` using `VariantsBlockStateSupplier.create()`. +Then we create a new `BlockStateVariantMap` that contains parameters for all variants of the block, in this case `FACING` & `SINGLE`, and pass it into the `VariantsBlockStateSupplier`. Specify which model and which transformations (uvlock, rotation) is used when using `.register()`.
For example: * On the first line, the block is facing north, and is single => we use the model with no rotation. @@ -290,18 +252,16 @@ For example: The last step - creating an actual method you can call and that will generate the JSONs. But what are the parameters for? -1. `BlockStateModelGenerator bsmg` is used for its variables. **Creating new ones won't work!** +1. `BlockStateModelGenerator bsmg`, the same one that got passed into `generateBlockStateModels`. 2. `Block vertSlabBlock` is the block to which we will generate the JSONs. 3. `Block fullBlock` - is the model used when the `SINGLE` property is false = the slab block looks like a full block. 4. `TextureMap textures` defines the actual textures the model uses. See the [Using Texture Map](#using-texture-map) chapter. @[code lang=java transcludeWith=:::datagen-model-custom:gen](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -Let's go over line by line to really understand what is going on: -1. Here we obtain the `Identifier` representing the vertical slab model via the `.upload()` method. We will pass in our [TextureMap](#using-texture-map) when calling this method. -2. Here we obtain the `Identifier` of the full block - in our case of Oak Log. -3. Here the `Consumer blockStateCollector` is called, accepting all of our blockstate variants. -4. Here we register an item model for the vertical slab. +First, we get the `Identifier` of the single slab model with `VERTICAL_SLAB.upload()`. Then we get the `Identifier` of the full block model with `ModelIds.getBlockModelId()`, and pass those two models into `createVerticalSlabBlockStates`. +The `BlockStateSupplier` gets passed into the `blockStateCollector`, so that the JSON files are actually generated. +Also, we create a model for the vertical slab item with `BlockStateModelGenerator.registerParentedItemModel()`. And that is all! Now all that's left to do is to call our method in our `ModelProvider`: From bf251a20c896594c2b942646cdc192025f6c3891 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 14:06:09 +0100 Subject: [PATCH 31/41] Made changes according to IMB11's requests --- develop/data-generation/block-models.md | 72 ++++++++++--------------- 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index fef69d98c..3d8254462 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -4,118 +4,100 @@ description: A guide to generating block models & blockstates via datagen. authors: - Fellteros - natri0 + - IMB11 --- # Block Model Generation {#model-generation} -::: info PREREQUISITES +::: info Prerequisites Make sure you've completed the [datagen setup](./setup) process first. ::: ## Setup {#setup} -First, we will need to create our ModelProvider. Create a plain Java class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. +First, we will need to create our ModelProvider. Create a class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. Lastly, create constructor matching super. -:::tip -If you're developing mods in JetBrains' Intellij Idea, you can press `Alt+Shift+Enter` while hovering over the problem to bring up a quick fix menu! -::: - @[code lang=java transcludeWith=:::datagen-model:provider](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. ## Blockstates and block models {#blockstates-and-block-models} -::: info PREREQUISITES -You'll have to register the blocks, to which you want the data to be generated. Also see the [blockstate](../blocks/blockstates.md) and [first block](../blocks/first-block.md) tutorials. -::: - ```java @Override public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { } ``` -This part of the tutorial will happen entirely in the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this class will be responsible for generating all the JSON files. +For block models, we will primarily be focusing on the `generateBlockStateModels` method. Notice the parameter `BlockStateModelGenerator blockStateModelGenerator` - this object will be responsible for generating all the JSON files. Here are some handy examples you can use to generate your desired models: ### Simple Cube All {#simple-cube-all} @[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -The easiest and most basic method there is. It generates a JSON model file for a normal cubic block. One texture is used for all six sides, in this case we use `steel_block`. +This it the most commonly used function. It generates a JSON model file for a normal `cube_all` block model. One texture is used for all six sides, in this case we use `steel_block`. @[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json) -It also generates a blockstate JSON file. Since we have no blockstates (e.g. Axis, Facing, ...), one variant is sufficient, and is used everytime the block is placed. +It also generates a blockstate JSON file. Since we have no blockstate properties (e.g. Axis, Facing, ...), one variant is sufficient, and is used every time the block is placed. @[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/steel_block.json) +Steel Block + ### Singletons {#singletons} -The `registerSingleton` method provides JSON model files based on the `TexturedModel` you pass in and a single blockstate variant. For example +The `registerSingleton` method provides JSON model files based on the `TexturedModel` you pass in and a single blockstate variant. @[code lang=java transcludeWith=:::datagen-model:cube-top-for-ends](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -will generate models for a normal cube, that uses a PNG file `pipe_block` for the sides and a PNG file `pipe_block_top` for the top and bottom sides. +This method will generate models for a normal cube, that uses the texture file `pipe_block` for the sides and the texture file `pipe_block_top` for the top and bottom sides. @[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/pipe_block.json) :::tip -If you're stuck choosing which TextureModel you should use, open the `TexturedModel` class and look at the [`TextureMaps`](#using-texture-map)! +If you're stuck choosing which `TextureModel` you should use, open the `TexturedModel` class and look at the [`TextureMaps`](#using-texture-map)! ::: +Pipe Block + ### Block Texture Pool {#block-texture-pool} @[code lang=java transcludeWith=:::datagen-model:block-texture-pool-normal](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures.
+Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures. In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. ***It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model.*** -Be aware of this, if you're changing block model of this particular block, as it will result in en error.
+Be aware of this, if you're changing block model of this particular block, as it will result in en error. You can also append a `BlockFamily`, which will generate models for all of its "children". -@[code lang=java transcludeWith=:::datagen-model:block-texture-pool-family](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) - +@[code lang=java transcludeWith=:::datagen-model:family-declaration](@/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java) +@[code lang=java transcludeWith=:::datagen-model:block-texture-pool-family](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -::: warning -Make sure you're using the correct Block class when passing in the block! -For example, in the `.stairs()` method, you have to pass in an instance of StairsBlock; in `.slab()`, it has to be an instance of SlabBlock and so on! -::: +Ruby Block ### Doors and Trapdoors {#doors-and-trapdoors} @[code lang=java transcludeWith=:::datagen-model:door-and-trapdoor](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -Doors and trapdoors are a little different. Here, you have to make three new textures - two for the door, and one for the trapdoor.
+Doors and trapdoors are a little different. Here, you have to make three new textures - two for the door, and one for the trapdoor. 1. **The door**. It has two parts - the upper half and the lower half. **Each needs its own texture:** in this case `ruby_door_top` for the upper half and `ruby_door_bottom` for the lower. -The `registerDoor()` method will create models for all orientations of the door, both open and closed.
+The `registerDoor()` method will create models for all orientations of the door, both open and closed. **You also need an item texture!** Put it in `assets//textures/item/` folder. 2. **The trapdoor**. Here, you need only one texture, in this case named `ruby_trapdoor`. It will be used for all sides. Since `TrapdoorBlock` has a `FACING` property, you can use the commented out method to generate model files with rotated textures = the trapdoor will be "orientable". Otherwise, it will look the same no matter the direction it's facing. -::: warning -Again, make sure the door and trapdoor blocks are instances of their corresponding block classes (`DoorBlock`, `TrapdoorBlock`)! -::: +Ruby Door and Trapdoor ## Custom Block Models and Datagen Methods {#custom-models-and-methods} -In this tutorial we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. - - -::: info THINGS WE WILL NEED -1. [Custom Block Class](#custom-block-class) -2. [Parent Block Model](#parent-block-model) -3. [Custom Model](#custom-model) -4. [Using Texture Map](#using-texture-map) -5. [Custom BlockStateSupplier Method](#custom-supplier-method) -6. [Custom Datagen Method](#custom-datagen-method) -::: +In this section we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. _Points 2. - 6. are declared in an inner static helper class called `CustomBlockStateModelGenerator`._ @@ -188,7 +170,7 @@ I highly recommend using [Blockbench](https://www.blockbench.net/) for this, as } ``` -See [how blockstates are formatted](https://minecraft.wiki/w/Blockstates_definition_format) for more information.
+See [how blockstates are formatted](https://minecraft.wiki/w/Blockstates_definition_format) for more information. Notice the `#bottom`, `#top`, `#side` keywords. They act as variables that can be set by models that have this one as a parent: ```json @@ -242,7 +224,7 @@ The `BlockStateSupplier` contains all blockstate variants, their rotation, and o First, we create a new `VariantsBlockStateSupplier` using `VariantsBlockStateSupplier.create()`. Then we create a new `BlockStateVariantMap` that contains parameters for all variants of the block, in this case `FACING` & `SINGLE`, and pass it into the `VariantsBlockStateSupplier`. -Specify which model and which transformations (uvlock, rotation) is used when using `.register()`.
+Specify which model and which transformations (uvlock, rotation) is used when using `.register()`. For example: * On the first line, the block is facing north, and is single => we use the model with no rotation. * On the fourth line, the block is facing west, and is single => we rotate the model on the Y axis by 270°. @@ -269,7 +251,7 @@ And that is all! Now all that's left to do is to call our method in our `ModelPr ## Sources and links {#sources-and-links} -Other examples of implementing custom datagen methods can be found [here](https://github.com/Fellteros/vanillablocksplus) and [here](https://github.com/Fellteros/vanillavsplus) -Textures, free to download: -Atlas of all textures +Other examples of using custom datagen methods have been created using [Vanilla+ Blocks](https://github.com/Fellteros/vanillablocksplus) and [Vanilla+ Verticals](https://github.com/Fellteros/vanillavsplus) mods. +You can also view the example tests in Fabric API and the Fabric docs reference mod for more information. + From 066f3193bc461e174e1acd6c407b91ce72aca2e4 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 14:06:47 +0100 Subject: [PATCH 32/41] Reformatted the RUBY_FAMILY --- .../src/main/java/com/example/docs/block/ModBlocks.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java index 5efb4bbac..360150d9a 100644 --- a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java @@ -128,7 +128,14 @@ public class ModBlocks { public static final Block VERTICAL_OAK_LOG_SLAB = registerBlock( "vertical_oak_log_slab", VerticalSlabBlock::new, AbstractBlock.Settings.create()); - public static final BlockFamily RUBY_FAMILY = new BlockFamily.Builder(RUBY_BLOCK).stairs(RUBY_STAIRS).slab(RUBY_SLAB).fence(RUBY_FENCE).build(); + // :::datagen-model:family-declaration + public static final BlockFamily RUBY_FAMILY = + new BlockFamily.Builder(ModBlocks.RUBY_BLOCK) + .stairs(ModBlocks.RUBY_STAIRS) + .slab(ModBlocks.RUBY_SLAB) + .fence(ModBlocks.RUBY_FENCE) + .build(); + // :::datagen-model:family-declaration // :::1 public static Block register(Block block, RegistryKey blockKey, boolean shouldRegisterItem) { From 8bbf9cc4f9965f8a6b350e35eb22edff14048bb4 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 14:07:10 +0100 Subject: [PATCH 33/41] Deleted as it isn't used anymore --- .../data-generation/block-model/atlas.png | Bin 1304 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 public/assets/develop/data-generation/block-model/atlas.png diff --git a/public/assets/develop/data-generation/block-model/atlas.png b/public/assets/develop/data-generation/block-model/atlas.png deleted file mode 100644 index 40aa60c229ed80a13bfceae8946c2c406c294473..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1304 zcmV+z1?T#SP)Px((n&-?RA_0bp4c0KHxhfQN?%1ifBQ&0Cg*Wmy~_ACne$cX#~u=Rc|CLki?mOKUhf zI!YyXa&iK|ZuMYf?dR1EtNVNEFF@Nr2f+4R0KRtf*%+Xs*XzZ+Xjzu>8bls8aqBlm zC;bK?1st_j1fUtbQucBH*&2|f@GSUwbpyb*x28^8=DR^Vw%7Jt>cOiT{}K;O8=GEO z-QNSh!Rr2Af+vdVQ%HfbF7y2^TLbjdPYR=1y`$%ZcxQEgj|=~L=n-d-5BX2ohfvaI zV8jUB3!85^LVvZ?%}@Jb3HK}Z3J6gH8W0dg}Zjg#(%Bt<3OSNHeSW#!Ok zhfwX?_SS&N6Tc*hlPb`p>LZm!47u>HhbuDYjFrv&9)QW!Nal1e*q)0MJmXd?xS(QR zhn&0^yTKFptY>e4uGqM;X`&mn32{bFUPpBM4%TeXg>J?kFqy15KM4+fm8fQ=G3RX0 z&Gsf1R+$DN1@7~o0Jvv8wq}miTo?F$hyBuL6`VBUCqC-)|n{bnm0uFsb z3hWTl#G&lvs0Xh&^cPb8_v_Qt@~5Y#aSyoF3Y{UD>IQ9G;&s@p2HkuC=cT_8p9eTQ zI|HCpDgp5L_!#>xnNPY5V+QEN$-cUw?VsaNR7LLXti3ZP~;%uBKnWpo{L+ps2G=%7x(LXb@^Mrp`IVX zGaZWRX=;X>{AZr9(W~4QLuvT9X{au*S20uGL>lE`n8b_laZ?`P!oQ~M<%U&kFyA!3 zu$8uo6#|I~W;a}6lA*2v{>cK1Z;8mTZgjnQ(C>Pvn1>19D_lTM3y1dYX zS(QILJXB+q0}|`{>C4!hD|@+^LV7~#M(G|9H+D8<#RV*;P01zKduKL>a5I;YTAwb9!P9x^bSinjY$PQ3MO`B;(lK3O>}fOr O0000 Date: Sun, 19 Jan 2025 14:07:50 +0100 Subject: [PATCH 34/41] Added previews and files for download into the assets folder --- .../data-generation/block-model/pipe_block.png | Bin 0 -> 130 bytes .../block-model/pipe_block_textures.zip | Bin 0 -> 731 bytes .../block-model/pipe_block_textures_big.png | Bin 0 -> 723 bytes .../block-model/pipe_block_top.png | Bin 0 -> 221 bytes .../data-generation/block-model/ruby_block.png | Bin 0 -> 393 bytes .../block-model/ruby_block_big.png | Bin 0 -> 846 bytes .../block-model/ruby_door_bottom.png | Bin 0 -> 388 bytes .../block-model/ruby_door_top.png | Bin 0 -> 388 bytes .../block-model/ruby_door_trapdoor_big.png | Bin 0 -> 1495 bytes .../block-model/ruby_door_trapdoor_textures.zip | Bin 0 -> 1758 bytes .../block-model/ruby_trapdoor.png | Bin 0 -> 393 bytes .../block-model/ruby_trapdoor_big.png | Bin 0 -> 393 bytes .../data-generation/block-model/steel_block.png | Bin 0 -> 1198 bytes .../block-model/steel_block_big.png | Bin 0 -> 1300 bytes 14 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/assets/develop/data-generation/block-model/pipe_block.png create mode 100644 public/assets/develop/data-generation/block-model/pipe_block_textures.zip create mode 100644 public/assets/develop/data-generation/block-model/pipe_block_textures_big.png create mode 100644 public/assets/develop/data-generation/block-model/pipe_block_top.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_block.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_block_big.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_door_bottom.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_door_top.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_door_trapdoor_big.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_door_trapdoor_textures.zip create mode 100644 public/assets/develop/data-generation/block-model/ruby_trapdoor.png create mode 100644 public/assets/develop/data-generation/block-model/ruby_trapdoor_big.png create mode 100644 public/assets/develop/data-generation/block-model/steel_block.png create mode 100644 public/assets/develop/data-generation/block-model/steel_block_big.png diff --git a/public/assets/develop/data-generation/block-model/pipe_block.png b/public/assets/develop/data-generation/block-model/pipe_block.png new file mode 100644 index 0000000000000000000000000000000000000000..12d43aaf60c28506a01e7cdb1c52441cc536b388 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Y&=~YLo9mV zo-t%>VBk4&prL8TiY2Soca}2s@%Xbyv?tDnm{r-UW|@l_~@ literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/pipe_block_textures.zip b/public/assets/develop/data-generation/block-model/pipe_block_textures.zip new file mode 100644 index 0000000000000000000000000000000000000000..6e3638f5cab1ced7390e7be8eaaabb3d9abd812d GIT binary patch literal 731 zcmWIWW@Zs#-~hr22}V&2NPv$)fuSI?AT>TICqFq`uOKhIw1S&~kp-j#OoWE;GO!=) z>Q3MMwI^NSOHcZ1o)5*(pH6y|l#uY?>z4vfrb|o;XAZKdJhlJt&l1#g)bX7k&+Bt1 z_plV@*u=^>>r~yJXPA!<-7kt-^G*cyJgk8EZQQzoZ~Hdk{$3M^6s&JYFC!!|Gcex z`u>J+*;hBW7A2=YKDgob?67@VbMg~%4t+>^U$5Hvq~-a!r@!yt`}^B_(e}Hcs^w?f zMfvx9=PH?V!{mO+UaiOP|E-Vi>#W^AXSH%sDcf}>01w4~b`FKN~r z3-unFt*ZYqBBwHV`-|jPA|HQduNK>;H$&v?>6(O_tG>+)uKcVkVg7Ym-X81IB2VJj z{KM_1m-=z~f`ji;=MS~}z@WPe4n9UE5oScvKn_|y1__`F2-wyLq6s7vRt82;LJ9Cj nm(0r%WME+G^>lFz zshIQj?!nwg4iXI)?_L#i5Z>ZcnAgc?QMjDb%EKx_q*u+X=6&qkhRKJQ$Itrs*t?;9{>Jj@_G46yZOQU|5w;7tE*2bso(tF{@4HB zb^mAoDtoY&lc5C-{gwZF;Azp%-rormb8mm!$I5qxg&~m%10AkqSlv6XJ?`(GA1^+q z&%Z7=^Y8D3Hco~^EEs6oduEGYRyI>+GAQ_9pf?|$GhW$$zmjoH3R8mtBRbmf^fyD8 z{rmba-`OnQHz*r3I?P}|M>pQRXSMkCy#LK!{{xkbXAH2a`C`}LUoThpzLw|O&&ZQl zy>$9K^Ni9jwJh_VKc9=kt?yYYzL)-s{3f_z5>~G+`_6b~o%8v1i`W1AclEvPhI8lV z`7j8mVW6@fpBci|e_kJVyd8(1KGia8{$^KRpMQ=!K~)$dmVlA=b{~JjSF3NYJ~OO2 z{P`SKYqr(MA9z*#H+=KC^Xk}xu0a04w%q-N@(1{^8t{!bDPvMqeKUg~D9w7h`njxg HN@xNAQfLf5 literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/pipe_block_top.png b/public/assets/develop/data-generation/block-model/pipe_block_top.png new file mode 100644 index 0000000000000000000000000000000000000000..2c6dbf3fced778167ea558b8046ee43aea6285f8 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|rhB?LhFJ8@ z4RqvdP~chJ#{MSMrf>P%Ez94qR~_ovwQ^%;Px$LrFwIR5*>DlfP=hP!z_0CYRvQB}=Xe^Z{IyLY6>R$4)+5AEBFfC@w-*K@g#} zeTQgVTt%vONX|7^W1;<)BZ9b$FO9@UzrD0aj)VK$OG) zylhmt0N~wBuPMxwf&gvLLI9TekwM}ClnV~C1pvLIZP}#0$yd(KD2aK?kM>&u<&c@; zXK90y(D6K|-u*0v*N?M>I_jB-IzLO9n0cj0mwBjr*Fqgq6ARHr&$?3PH4O>sdEA26 z)F|Pt%$PMHOEjPP&SCDbJuhgoASei&fkp+=D1QAcwU%9(P7P1aozPO_`qI>GFW%&zB69$Rr{tKGD4eB!K%UYDg n_9nKT>7O<#_!GMz`rh*cB-4Wur5P%y00000NkvXXu0mjfX9la? literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_block_big.png b/public/assets/develop/data-generation/block-model/ruby_block_big.png new file mode 100644 index 0000000000000000000000000000000000000000..10b7c06e6906938c9555def830dd9204d9f0ae21 GIT binary patch literal 846 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-HD>VCL|2aSW-L z^Y-q>ERjG7_m7dWM-ClJyB_<2@sdVUZ^G;7Loz3{lY`0@8q$MvtRzV@;G_AmE0JPhd!1#C!!_0Sd%wY$VGiQ~NhBg>5C4Q~rzfYsZhu-)zSq|C z`Tn~xJb(YFto^>9|2yNZIgAf@7|t;u5szvcD(1>vJAL`%?)rHPw#Ut1@|^eE?E3mY zKj+MudiWfwdw|Y+`<=;6dau3X_saGX*}AGfD`n1~SJpXwamW7ye=;pGyi%t?i{Yy~AO14#y7l`{>+3&T=E?2% zPx!p}-=Bh-a@+qWzwDLyZ)K}>d@hF1^8Qvc#=f+&_q_ga`oq8fVvE_3A_N>Y+55#O ztXur~_xG<=6;*PId*{!$tGE2CbNq5?UHGrKqhIzmzT;mYh8&N^3_B|17wn#2JL#SB zlE2?Jzx#Rj&DTGA>F|h#MmbPb!p69%k6-@%arNNrDw~?RUvYchRaJyXo%i4MJ@Ssc zgD!GB1H%=RgjW4xerfgjPv83K_e*}i{#E{?Ao~8RLQH4B=QsHE_t(YWFUx!F_J6T) z`(xKWd2`VXNz|C-VaWSdRuyN*zhUn8ZDFESo{1Uu|Cn5*dQaOdiiref5C%_I KKbLh*2~7aWBY%1T literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_door_bottom.png b/public/assets/develop/data-generation/block-model/ruby_door_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..624b156c581223acbf932586d7f5649cd22926bc GIT binary patch literal 388 zcmV-~0ek+5P)Px$K1oDDR5*=|lDkgBFcgNrhA3iS=@Q3&gDymsSdhAQ?38EY5!mVhWkKp%2?-&U z!aF2QmaJ6;l%X8U4khAWe9`gwFFvCsljF3Qv9W71I(Ce?HkSZg+}^OUYZ?+12O1J` z8n!6rCSp~65#d1>3%75p8i0lbfQ*hl+BgXtd_KK6=G16vTcS7wk9LfMbL2k^y7v?a z`br{U^jCn?Xmqh~3WPZ|I;agS^ikW=DVP?sKv`|eVGDp$kkkCC5k+T1^l>hIA3+9w zqqeH4ZOM)?TNH2AK46x{gBD>P0B{)yWJ*Oz43eyJjUMguPr2NwKNZGs z`dd})(ZvD{&btp`7P5?vcdi&MnH)1ZwgW8ZFgFqRZG2K7UL~l0(*3*C=+nPx$K1oDDR5*>Dlf7!gKoEq#NJ6-EBjpbA0BIZoY6NLrs?sy2%N4_BXc6$rUZ7DCSs iZwll6+Pd1&Psbn6YmBh8b9HwB0000b`xE{55d=+G_77Exn_Lmdt~CS}UzwjzbOMG6WGhEVJE*o<~A zP9{uQ7Rt?Su5`|pDacAGhmyz~VhODrRoY`pxs{8p?zmp>=-sWv7};jnKi~KL^FH76 zJn!?qM>En>=gwL*3jlz*vaKoG0U)X}@~)imWaOOI*giXQMU`$(-3*wn$NB)^i4(Gv zO_>#Scim|Iv#O_KhFohtJKVFDeWPRcz-#mOMk~5AEm!WYJv=Z&wJ>_VvnOd-x%;K> z{GLnf5?yX}9ihUnU8@az5ME#GS&j0xFpFQ-mo*Q@W98i~CA{l?cL{&zYOc0=~!j^d; zWs4*{6l%yq=Rl#WG`j`jiw}<0r1yckv%OvDMbg$-wZw_@a7zG|{}X(96!7v_0Px)F zk-wi|qL!-axsg`Na|=}_1wb}-#9~n2Q=~!tve8bDgpfl6)(pfCezMdi`Qyh@F>c+s zfV#v3K;xoGIFmKp1}h7tOigEu_dvO4e>Dhy6Ng?*2#hC;MVZej#O5-xWj_L!IPkb3 zL5cMqD*7zz&2xJHqaUvf=lba1Up=Q{zn4n_ySn zLR?QEptykRDAMq5G0DworajO&ncG8uf0g7E*pDks2Lyi`<{2k47aY7PT*2k#i=h$+iNwZA zPm(?es5%wz<@#~^7-tnVG!y-(1OH}s7M0|X;OzvnMn*NMT&;p^lrrogBXtG!{|(AR zzh3lD{|#!Q6KRt(HI`88Ks-S{o^Mf_0@u-gOwv_Os10E7f;X28kD7%uUyw*v18nin z1aclCOr&8lmq-`S5o+^Fntj12Ve(zg*U>e!*$A)nJMw~;2ns9I@RH+IqtXiAm=&Bt z&_~jZ)m)wx>QF6awWZnNLiTNw0mMylI?3;}gF+%HsjsNzm_eFL&aX!m;>Y0+E09g) z$i}{NaP8FDD3O*IdCEpFK$^eW%LIY2x~V~{Q^^;Q+GL|(o=1wE*>!CzFe}Zs-N(DS z8mn?$ns-+HPcp=N-)7-@cqKNWk1pn&T~<1AEWy6P7kt;CruU?|W9k~ E8_ht>=Kufz literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_textures.zip b/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_textures.zip new file mode 100644 index 0000000000000000000000000000000000000000..06cbe60ef7a5a6b60b4e1265215cbb3bf3e4b953 GIT binary patch literal 1758 zcmWIWW@Zs#-~hr^u|`o0NI--^fuX20sWLt#KffqGDZiv7KUc3HFTJ#an}Lx9q!3Jm zhVU}5JGOPF&;QnwuJENNow0?n`d?>&pF1y?6cEak-(c3#|x8Gp{k+%J98c7K+g^t%X>$yygn6Rtt&6M=Vf;V0< zraHcg;^b7EddOPEciNgz)+q~RPV=cgim$o&@u$AsV%5oyx6IhMG26(htY@d$bcUEa z_cmXm!@*?;GqmG+{?3Vub0zP)&qiTB)Y{zS1&J$>ctBy?xW7+Y;))_HDVF8DpS zCP*Ppbw%B!zq_xzxP0DrkI^n=`)!35@Bh30DtsUlCEs9u2<)q*HdU6NmbE1qqE@vH-kV~XQ>?&Q5$haCi3_Io(( zC{=#S_lY4>hAE3BGj`P_<7KBs5B4gqJ($4L`AOhc_9Zq!Yt1K9-={47Xfo+tS$g_2 zKXd&%|BFD_HPYb3wJA2r?Im@VV zO4<7@;}@3pw{i`w^LQ_(?A6t7H@?)h{gXuvyTknyvmcp83sc@z#Lc_+*QD`!|7KR{ zGPOnL{DrTjl?RD@uVg7-$11%^O>9x1Z*9;sUsKLEHvgKQkHrAzfKEY z=G`Qhk#YJ|pn|#orUD}Y)=90WjFr~Pus&Y!wEn{zhnyZ!j-5VYPUrdZxgP($wd>YJ z|KsxKvwJpdDK0HXk7r-D*?TbKITTksmlP!yfU-5NcwXF!6wjTEWu)h4XGngYJ9&TB zp#YI%^=i`}Tu}91$N7aZW{T4^hw$TmcG2<+XP0Z}IfXk4EZkb#o)Ht{x~k0MoN0LS z!oSm0p3f`ZXMbmlTZ#W4VOB=22Z=u_N-JjQe%O4)jxj8a$6?A5hCMkUI~g9_^;xfZ zW=a!7?s+GMX+I}AK4P50&9|AAVegXMn@jec3_o{HqqFjK|F>wyrxRvAO3!Sbbm61T zihF-`T7fa$YV~Snhn2ne%o&wSJ*HQ#sJ`wb8zjtq(e?bUpl7DMoUbbHG+n=<@o?># z8K#QfCi8!uOMJJ%RzG8tf(FN&MmN?=8g+klwoZ55yxc#Ly~^`;;39_EYjkGKsJyCY zS{uBu=~K~*8h4u-CAQal`GEPFFM8jO#iom@Uu{VJ$?Yx7*7^J&_pH6VuZ&)vj+%1h zo7%Q{FXx+S{Se-*@ax`ZW|hm$LQ5sJR-i|An!0dpA236MB0RvGkx7IZQGz39co7B( zkXA6*)(E1AD$iLN7(wMZvdN$V138HaqL};|=njO*xQY*;v7q7u*;r8eMD`4-v6q>l d#^Oz_Kx09vHNcw{RJAZL10e^{JqK7pJOF&yY03Zq literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_trapdoor.png b/public/assets/develop/data-generation/block-model/ruby_trapdoor.png new file mode 100644 index 0000000000000000000000000000000000000000..75c79bc311090c23aa156220064eb8619303c4bf GIT binary patch literal 393 zcmV;40e1e0P)Px$LrFwIR5*>DlfP=hP!z_0CYRvQB}=Xe^Z{IyLY6>R$4)+5AEBFfC@w-*K@g#} zeTQgVTt%vONX|7^W1;<)BZ9b$FO9@UzrD0aj)VK$OG) zylhmt0N~wBuPMxwf&gvLLI9TekwM}ClnV~C1pvLIZP}#0$yd(KD2aK?kM>&u<&c@; zXK90y(D6K|-u*0v*N?M>I_jB-IzLO9n0cj0mwBjr*Fqgq6ARHr&$?3PH4O>sdEA26 z)F|Pt%$PMHOEjPP&SCDbJuhgoASei&fkp+=D1QAcwU%9(P7P1aozPO_`qI>GFW%&zB69$Rr{tKGD4eB!K%UYDg n_9nKT>7O<#_!GMz`rh*cB-4Wur5P%y00000NkvXXu0mjfX9la? literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_trapdoor_big.png b/public/assets/develop/data-generation/block-model/ruby_trapdoor_big.png new file mode 100644 index 0000000000000000000000000000000000000000..75c79bc311090c23aa156220064eb8619303c4bf GIT binary patch literal 393 zcmV;40e1e0P)Px$LrFwIR5*>DlfP=hP!z_0CYRvQB}=Xe^Z{IyLY6>R$4)+5AEBFfC@w-*K@g#} zeTQgVTt%vONX|7^W1;<)BZ9b$FO9@UzrD0aj)VK$OG) zylhmt0N~wBuPMxwf&gvLLI9TekwM}ClnV~C1pvLIZP}#0$yd(KD2aK?kM>&u<&c@; zXK90y(D6K|-u*0v*N?M>I_jB-IzLO9n0cj0mwBjr*Fqgq6ARHr&$?3PH4O>sdEA26 z)F|Pt%$PMHOEjPP&SCDbJuhgoASei&fkp+=D1QAcwU%9(P7P1aozPO_`qI>GFW%&zB69$Rr{tKGD4eB!K%UYDg n_9nKT>7O<#_!GMz`rh*cB-4Wur5P%y00000NkvXXu0mjfX9la? literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/steel_block.png b/public/assets/develop/data-generation/block-model/steel_block.png new file mode 100644 index 0000000000000000000000000000000000000000..2a5f6549b32d31b5a62ec984a7fcb6477a23cf23 GIT binary patch literal 1198 zcmd^;v5ONy6vm&VxVu1b5riNSr!&oB_GF7euXsn+GaxaW+#)Ae7&ORX_0)ic)pQ0F zLF6FCfo;$uty=`;EROYvVs{FzR${e{Xkqc3xoQ{YKk&^r?+xGY%@o7TqfUFRQa)7% zfJ*Cfv#YCP=3+_bx_i8*%dvaiwN==i*M0(&pmSwC&?dk{5133$(j_v>$OP*VF`IN$ z^ip>_jw6KdeLn~S-82{shQr}#G#Zb`dSe{NNs^>#nq}EhKO?XLo`K%1HDgc=s1M46 zoNEV4@s8q|;#4skrL1PGcDM*~t{ucNCo!inXEC!;#&ODV!bOmC?ErvkKoTedBBO{v z64a;&a;_anNr9wDQeP4o^+`q~11f@?YX@OS8zJ>W+6sw`wkYgVxIsmbbL{{C9Y6u- z0iuzIAP^iZf}CpyLSS8>Cr}DRBZtPY(Tstt& z+!kkF9NyLc0`7O)J^eiY>nLykx~T7{(`w>+^?CHtv2;Fou>beN;pbN;_7*;! z-k&z^oNL~?G`%+LeOsr{>p{yk_<$& zr#b~{LUh~1;wfx`WvN542MMx3ibgvWDzXt)MC7mE^E3nVAN1aL-tY1K{C;nSnK$p= zKz~nDjmdv26_?1_S2?EinN~(xFt+g9JxU z9o<;E!>os$AXCXsBoa!gOeSMlmL!dijur}qVzD?qJuQWv=hbR8-}meF`c6J0unSxP zDHc^2Tn3bdf*{~V1J~s_mn$y&F0+=;ZiU@B4ugOj4Lpx)9{V2GJ!Y*sdp>(L4ugOj z4FISO$OLkLNXsEG3EC(O0&X-gO|ndKOv;-?T6r=ZGA#;&fEx{Ln}%%4+cahqX^oMc zCwqv(AmBy=089WXz%(Fgr4bZD0>dESMgyg=Q(;=6sSveHRB2S57zP118W;wq4a^wW zWgu#Gp^-r&jbRXQqk-P$QSIpCErJC6Z-(hJF0`NLOW8)vaEHweWjF=aB4)u z`+FCT4gZqoc{a5+{-^=qJ2bC{R?%UDJ1q&CbZe^T}`V$;*d7EW?p&`YZQY K{n>K&i2Dzx*^S2l literal 0 HcmV?d00001 From 1458660f406ddae6bd83c2e32ca948da8d93c21b Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 14:13:37 +0100 Subject: [PATCH 35/41] Fixed a few typos --- develop/data-generation/block-models.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index 3d8254462..9b37b0083 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -37,7 +37,7 @@ Here are some handy examples you can use to generate your desired models: @[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -This it the most commonly used function. It generates a JSON model file for a normal `cube_all` block model. One texture is used for all six sides, in this case we use `steel_block`. +This is the most commonly used function. It generates a JSON model file for a normal `cube_all` block model. One texture is used for all six sides, in this case we use `steel_block`. @[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json) @@ -97,14 +97,14 @@ Otherwise, it will look the same no matter the direction it's facing. ## Custom Block Models and Datagen Methods {#custom-models-and-methods} -In this section we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. +In this section, we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. _Points 2. - 6. are declared in an inner static helper class called `CustomBlockStateModelGenerator`._ ### Custom Block Class {#custom-block-class} -Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there's both slabs. -Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly and the block has the correct collision shape. +Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there are both slabs. +Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly, and the block has the correct collision shape. @[code lang=java transcludeWith=:::datagen-model-custom:voxels](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) From 109dafd3cfa94ecfc5b0e9e219fdd5f8444f18a3 Mon Sep 17 00:00:00 2001 From: Fellteros <144528463+Fellteros@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:20:30 +0100 Subject: [PATCH 36/41] (Hopefully) fixed all markdown-lint issues in block-models.md --- develop/data-generation/block-models.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index 9b37b0083..5b731d076 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -22,7 +22,7 @@ Lastly, create constructor matching super. Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. -## Blockstates and block models {#blockstates-and-block-models} +## Blockstates and Block Models {#blockstates-and-block-models} ```java @Override @@ -69,7 +69,7 @@ If you're stuck choosing which `TextureModel` you should use, open the `Textured Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures. In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. -***It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model.*** +**_It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model._** Be aware of this, if you're changing block model of this particular block, as it will result in en error. You can also append a `BlockFamily`, which will generate models for all of its "children". @@ -199,6 +199,7 @@ The `TextureKey`s represent the "placeholders" (`#bottom`, `#top`, ...) as an Ob What does `TextureMap` do? It actually provides the Identifiers that point to the textures. It technically behaves like a normal map - you associate a `TextureKey` (Key) with an `Identifier` (Value). You can: + 1. Use the Vanilla ones, e.g. `TextureMap.all()`(associates all TextureKeys with the same Identifier) or other. 2. Create a new one by creating a new instance and then using `.put()` to associate keys with values. @@ -213,7 +214,7 @@ Since we want to use the Oak Log textures, but have the ``BOTTOM``, ``TOP`` and The ``bottom`` and ``top`` faces will use `oak_log_top.png`, the sides will use `oak_log.png`. ::: warning -All `TextureKey`s in the TextureMap **have to** match all `TextureKey`s in your parent block model! +All `TextureKey`s in the TextureMap **have to** match all `TextureKey`s in your parent block model! ::: ### Custom BlockStateSupplier Method {#custom-supplier-method} @@ -225,15 +226,17 @@ The `BlockStateSupplier` contains all blockstate variants, their rotation, and o First, we create a new `VariantsBlockStateSupplier` using `VariantsBlockStateSupplier.create()`. Then we create a new `BlockStateVariantMap` that contains parameters for all variants of the block, in this case `FACING` & `SINGLE`, and pass it into the `VariantsBlockStateSupplier`. Specify which model and which transformations (uvlock, rotation) is used when using `.register()`. -For example: -* On the first line, the block is facing north, and is single => we use the model with no rotation. -* On the fourth line, the block is facing west, and is single => we rotate the model on the Y axis by 270°. -* On the sixth line, the block is facing east, but isn't single => it looks like a normal oak log => we don't have to rotate it. +For example: + +- On the first line, the block is facing north, and is single => we use the model with no rotation. +- On the fourth line, the block is facing west, and is single => we rotate the model on the Y axis by 270°. +- On the sixth line, the block is facing east, but isn't single => it looks like a normal oak log => we don't have to rotate it. ### Custom Datagen Method {#custom-datagen-method} The last step - creating an actual method you can call and that will generate the JSONs. But what are the parameters for? + 1. `BlockStateModelGenerator bsmg`, the same one that got passed into `generateBlockStateModels`. 2. `Block vertSlabBlock` is the block to which we will generate the JSONs. 3. `Block fullBlock` - is the model used when the `SINGLE` property is false = the slab block looks like a full block. @@ -249,9 +252,7 @@ And that is all! Now all that's left to do is to call our method in our `ModelPr @[code lang=java transcludeWith=:::datagen-model-custom:method-call](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -## Sources and links {#sources-and-links} +## Sources and Links {#sources-and-links} Other examples of using custom datagen methods have been created using [Vanilla+ Blocks](https://github.com/Fellteros/vanillablocksplus) and [Vanilla+ Verticals](https://github.com/Fellteros/vanillavsplus) mods. You can also view the example tests in Fabric API and the Fabric docs reference mod for more information. - - From fdce0da784b6ca6b4e6b3c27091e02f6632f0ab1 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Sun, 19 Jan 2025 14:13:37 +0100 Subject: [PATCH 37/41] Fixed a few typos and optimized imports --- develop/data-generation/block-models.md | 8 ++++---- .../src/main/java/com/example/docs/block/ModBlocks.java | 1 - .../com/example/docs/block/custom/VerticalSlabBlock.java | 4 ---- .../src/main/java/com/example/docs/item/ModItems.java | 2 -- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index 3d8254462..9b37b0083 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -37,7 +37,7 @@ Here are some handy examples you can use to generate your desired models: @[code lang=java transcludeWith=:::datagen-model:cube-all](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -This it the most commonly used function. It generates a JSON model file for a normal `cube_all` block model. One texture is used for all six sides, in this case we use `steel_block`. +This is the most commonly used function. It generates a JSON model file for a normal `cube_all` block model. One texture is used for all six sides, in this case we use `steel_block`. @[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/steel_block.json) @@ -97,14 +97,14 @@ Otherwise, it will look the same no matter the direction it's facing. ## Custom Block Models and Datagen Methods {#custom-models-and-methods} -In this section we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. +In this section, we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. _Points 2. - 6. are declared in an inner static helper class called `CustomBlockStateModelGenerator`._ ### Custom Block Class {#custom-block-class} -Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there's both slabs. -Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly and the block has the correct collision shape. +Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there are both slabs. +Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly, and the block has the correct collision shape. @[code lang=java transcludeWith=:::datagen-model-custom:voxels](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) diff --git a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java index 360150d9a..d9df4d35e 100644 --- a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java @@ -7,7 +7,6 @@ import net.minecraft.block.BlockSetType; import net.minecraft.block.DoorBlock; import net.minecraft.block.FenceBlock; -import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.block.PillarBlock; import net.minecraft.block.SlabBlock; import net.minecraft.block.StairsBlock; diff --git a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java index f7e565b27..e0c3bf482 100644 --- a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java +++ b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java @@ -2,7 +2,6 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; import net.minecraft.block.ShapeContext; import net.minecraft.item.ItemPlacementContext; import net.minecraft.state.StateManager; @@ -11,12 +10,9 @@ import net.minecraft.state.property.Properties; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; -import net.minecraft.world.WorldView; -import net.minecraft.world.tick.ScheduledTickView; import org.jetbrains.annotations.Nullable; diff --git a/reference/latest/src/main/java/com/example/docs/item/ModItems.java b/reference/latest/src/main/java/com/example/docs/item/ModItems.java index aa18ea6d9..7cec1f133 100644 --- a/reference/latest/src/main/java/com/example/docs/item/ModItems.java +++ b/reference/latest/src/main/java/com/example/docs/item/ModItems.java @@ -33,8 +33,6 @@ import com.example.docs.item.custom.CounterItem; import com.example.docs.item.custom.LightningStick; -import java.util.function.Function; - // :::1 public class ModItems { // :::1 From f291c7660f5d66e73165b2a35e6da46bcae618a6 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Mon, 20 Jan 2025 15:23:49 +0100 Subject: [PATCH 38/41] Checkstyle fixes --- .../FabricDocsReferenceModelProvider.java | 28 ++++++++----------- .../com/example/docs/block/ModBlocks.java | 12 ++++---- .../docs/block/custom/VerticalSlabBlock.java | 18 ++++++++---- .../java/com/example/docs/item/ModItems.java | 2 -- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java index fdb021bf3..cd4c68c3d 100644 --- a/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -1,12 +1,7 @@ package com.example.docs.datagen; // :::datagen-model:provider -import com.example.docs.FabricDocsReference; -import com.example.docs.block.ModBlocks; -import com.example.docs.block.custom.VerticalSlabBlock; - -import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider; -import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import java.util.Optional; import net.minecraft.block.Block; import net.minecraft.block.Blocks; @@ -26,7 +21,12 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.Direction; -import java.util.Optional; +import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; + +import com.example.docs.FabricDocsReference; +import com.example.docs.block.ModBlocks; +import com.example.docs.block.custom.VerticalSlabBlock; public class FabricDocsReferenceModelProvider extends FabricModelProvider { public FabricDocsReferenceModelProvider(FabricDataOutput output) { @@ -67,13 +67,10 @@ public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGen ); // :::datagen-model-custom:method-call - - // :::datagen-model:provider } - // :::datagen-model:provider - + // :::datagen-model:provider // used just for examples, not for actual data generation @SuppressWarnings("unused") @@ -96,10 +93,8 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) { // :::datagen-model:provider - // Inner class containing all Objects needed for the custom datagen tutorial. public static class CustomBlockStateModelGenerator { - // :::datagen-model-custom:model public static final Model VERTICAL_SLAB = block("vertical_slab", TextureKey.BOTTOM, TextureKey.TOP, TextureKey.SIDE); @@ -112,6 +107,7 @@ private static Model block(String parent, TextureKey... requiredTextureKeys) { private static Model block(String parent, String variant, TextureKey... requiredTextureKeys) { return new Model(Optional.of(Identifier.of(FabricDocsReference.MOD_ID, "block/" + parent)), Optional.of(variant), requiredTextureKeys); } + // :::datagen-model-custom:model // :::datagen-model-custom:texture-map @@ -121,6 +117,7 @@ public static TextureMap blockAndTopForEnds(Block block) { .put(TextureKey.BOTTOM, ModelIds.getBlockSubModelId(block, "_top")) .put(TextureKey.SIDE, ModelIds.getBlockModelId(block)); } + // :::datagen-model-custom:texture-map // :::datagen-model-custom:supplier @@ -137,6 +134,7 @@ private static BlockStateSupplier createVerticalSlabBlockStates(Block vertSlabBl .register(Direction.SOUTH, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true)) .register(Direction.WEST, false, BlockStateVariant.create().put(VariantSettings.MODEL, fullBlockId).put(uvlock, true))); } + // :::datagen-model-custom:supplier // :::datagen-model-custom:gen @@ -146,12 +144,10 @@ public static void registerVerticalSlab(BlockStateModelGenerator bsmg, Block ver bsmg.blockStateCollector.accept(createVerticalSlabBlockStates(vertSlabBlock, slabModel, fullBlockModel)); bsmg.registerParentedItemModel(vertSlabBlock, slabModel); } - // :::datagen-model-custom:gen - + // :::datagen-model-custom:gen } - // :::datagen-model:provider @Override public String getName() { diff --git a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java index d9df4d35e..50e2b5f42 100644 --- a/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java +++ b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java @@ -1,6 +1,8 @@ package com.example.docs.block; -import com.example.docs.block.custom.VerticalSlabBlock; +import java.util.function.Function; + +import org.jetbrains.annotations.NotNull; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; @@ -27,12 +29,9 @@ import com.example.docs.block.custom.CounterBlock; import com.example.docs.block.custom.EngineBlock; import com.example.docs.block.custom.PrismarineLampBlock; +import com.example.docs.block.custom.VerticalSlabBlock; import com.example.docs.item.ModItems; -import org.jetbrains.annotations.NotNull; - -import java.util.function.Function; - // :::1 public class ModBlocks { // :::1 @@ -165,14 +164,15 @@ private static Block registerBlock(String name, @NotNull Function keyOfItem(String name) { return RegistryKey.of(RegistryKeys.ITEM, Identifier.of(FabricDocsReference.MOD_ID, name)); } + private static RegistryKey keyOfBlock(String name) { return RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(FabricDocsReference.MOD_ID, name)); } - public static void initialize() { setupItemGroups(); } diff --git a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java index e0c3bf482..f980dc142 100644 --- a/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java +++ b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java @@ -1,5 +1,9 @@ package com.example.docs.block.custom; +import java.util.Objects; + +import org.jetbrains.annotations.Nullable; + import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.ShapeContext; @@ -14,10 +18,6 @@ import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - // :::datagen-model-custom:constructor public class VerticalSlabBlock extends Block { // :::datagen-model-custom:constructor @@ -37,6 +37,7 @@ public class VerticalSlabBlock extends Block { public VerticalSlabBlock(Settings settings) { super(settings); } + // :::datagen-model-custom:constructor // :::datagen-model-custom:collision @@ -45,6 +46,7 @@ protected VoxelShape getSidesShape(BlockState state, BlockView world, BlockPos p boolean type = state.get(SINGLE); Direction direction = state.get(FACING); VoxelShape voxelShape; + if (type) { switch (direction) { case WEST -> voxelShape = WEST_SHAPE.asCuboid(); @@ -53,6 +55,7 @@ protected VoxelShape getSidesShape(BlockState state, BlockView world, BlockPos p case NORTH -> voxelShape = NORTH_SHAPE.asCuboid(); default -> throw new MatchException(null, null); } + return voxelShape; } else { return VoxelShapes.fullCube(); @@ -68,21 +71,24 @@ protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos protected VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { return this.getSidesShape(state, world, pos); } + // :::datagen-model-custom:collision // :::datagen-model-custom:replace @Override protected boolean canReplace(BlockState state, ItemPlacementContext context) { Direction direction = state.get(FACING); + if (context.getStack().isOf(this.asItem()) && state.get(SINGLE)) { if (context.canReplaceExisting()) { return context.getSide().getOpposite() == direction; } } + return false; } - // :::datagen-model-custom:replace + // :::datagen-model-custom:replace // :::datagen-model-custom:placement @Override @@ -117,8 +123,8 @@ public BlockState getPlacementState(ItemPlacementContext ctx) { protected void appendProperties(StateManager.Builder builder) { builder.add(SINGLE, FACING); } - // :::datagen-model-custom:append + // :::datagen-model-custom:append // :::datagen-model-custom:constructor } diff --git a/reference/latest/src/main/java/com/example/docs/item/ModItems.java b/reference/latest/src/main/java/com/example/docs/item/ModItems.java index 7cec1f133..766f215ce 100644 --- a/reference/latest/src/main/java/com/example/docs/item/ModItems.java +++ b/reference/latest/src/main/java/com/example/docs/item/ModItems.java @@ -108,8 +108,6 @@ public class ModItems { SUSPICIOUS_SUBSTANCE_KEY ); // :::2 - - // :::1 public static Item register(Item item, RegistryKey registryKey) { // Register the item. From bea15b93a3a4780d4c42e31149a2da9bb650e6d6 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Mon, 20 Jan 2025 17:24:38 +0100 Subject: [PATCH 39/41] Added item texture for Ruby Door, added it to the textures .zip folder and to the preview --- .../data-generation/block-model/ruby_door.png | Bin 0 -> 315 bytes .../block-model/ruby_door_trapdoor_big.png | Bin 1495 -> 1812 bytes .../ruby_door_trapdoor_textures.zip | Bin 1758 -> 2252 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/assets/develop/data-generation/block-model/ruby_door.png diff --git a/public/assets/develop/data-generation/block-model/ruby_door.png b/public/assets/develop/data-generation/block-model/ruby_door.png new file mode 100644 index 0000000000000000000000000000000000000000..b841cb71eadd5561c5acc694f977114d4315a42b GIT binary patch literal 315 zcmV-B0mS}^P)Px#^+`lQR5*>rk~?n0Fc3svB7sPeMvZXBG5seLvHIBBAzA4f#ll7oS4 z6;MzPhN86A7zGqTIhliT2IJQoJeukZh}#{E(IN;rS??zTEdp89+P+$$4b~REHaqy6 zylH(_2Y_{DH#rFC2szQ<>E0VW;P->&az;RX)g!L}Iw~9``2FQfegN|GOkZU;fzSW| N002ovPDHLkV1f;!focE% literal 0 HcmV?d00001 diff --git a/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_big.png b/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_big.png index ec48b0c841cc30820c93447f7d1d87dacc5401f9..18802ad1bd43b74a93a1e616cf3752de57b4d483 100644 GIT binary patch literal 1812 zcma)6Yfuws6kSRc9|bxVhE~wvlo7GMTG0X{S&FuTC}02)4W#HOT0}4bd6;Bh)DsSErfeiwOXH2)fg4l<%ZN-kqS|1FEOmPrm~?H{(Z?4$Nn2q{Ura!5qeX08-*iS`@`T;beklWfFBg%eobgHTDDwYbh-ns*`Tgs9mvqwW|?M zC&OObBL)*@?YSOL*L8@YD#gMC^&9H;MxIAMa!)^IJHokh0N~;RyGgD5S~%$$ z2&&8@@P4c>r?-IL%-}yQ$nnP)c+mU9)Cwja3B3b$A%CFiCMxOK%f1|(iV~n0CyFF) zu1eeAFMoOKtpFzWC4cV)fz`6QsiU!?;(;*(Yt1&?p(Y%37 z9?l^dt_7SL2)7RR8`4?=ygjdV!{?*b-ZCbiI;gOWOmQSX@c=F(v&Q)=Q{vsbZ(7o= zxJfn4R4g{d(zO`~98D)Z8>JJOY-<2p(v5M)$kFx1J8yUdT35S`fiapNOKtXtJ(XaG z-EDod-FvlqD`UUM;Ua@JO~502(gIC;PZfxWtR!Qe$c%j#Eu9 z8?UV(AE%1*WCLgg)8w1?qQi8q4~P4R?Y~=k#B`aA7u;_5+33{tSTI*tRN4X)6N}nH zkSy5DjS6VS9aMVcxc^5GZ5F3f$~O2EJQxy9G#hO(YPBCApnV2haWMOZf=4w-5?#)g)p?15)#wA-SC&$;m4-%N9Sf8uO$F4OFvpYkf=ptqzd@HK1^__ zOo6>Z8x>nfO~5#=&X7X%4{&y&4yhj}dp%Ad-~&yj8HHR$>L;eD#KYZ^?**=`x}Q{O Q3sNBT+wgVb;O~$A1A)Rz_W%F@ literal 1495 zcmah}e@qi+7(SE@e>b`xE{55d=+G_77Exn_Lmdt~CS}UzwjzbOMG6WGhEVJE*o<~A zP9{uQ7Rt?Su5`|pDacAGhmyz~VhODrRoY`pxs{8p?zmp>=-sWv7};jnKi~KL^FH76 zJn!?qM>En>=gwL*3jlz*vaKoG0U)X}@~)imWaOOI*giXQMU`$(-3*wn$NB)^i4(Gv zO_>#Scim|Iv#O_KhFohtJKVFDeWPRcz-#mOMk~5AEm!WYJv=Z&wJ>_VvnOd-x%;K> z{GLnf5?yX}9ihUnU8@az5ME#GS&j0xFpFQ-mo*Q@W98i~CA{l?cL{&zYOc0=~!j^d; zWs4*{6l%yq=Rl#WG`j`jiw}<0r1yckv%OvDMbg$-wZw_@a7zG|{}X(96!7v_0Px)F zk-wi|qL!-axsg`Na|=}_1wb}-#9~n2Q=~!tve8bDgpfl6)(pfCezMdi`Qyh@F>c+s zfV#v3K;xoGIFmKp1}h7tOigEu_dvO4e>Dhy6Ng?*2#hC;MVZej#O5-xWj_L!IPkb3 zL5cMqD*7zz&2xJHqaUvf=lba1Up=Q{zn4n_ySn zLR?QEptykRDAMq5G0DworajO&ncG8uf0g7E*pDks2Lyi`<{2k47aY7PT*2k#i=h$+iNwZA zPm(?es5%wz<@#~^7-tnVG!y-(1OH}s7M0|X;OzvnMn*NMT&;p^lrrogBXtG!{|(AR zzh3lD{|#!Q6KRt(HI`88Ks-S{o^Mf_0@u-gOwv_Os10E7f;X28kD7%uUyw*v18nin z1aclCOr&8lmq-`S5o+^Fntj12Ve(zg*U>e!*$A)nJMw~;2ns9I@RH+IqtXiAm=&Bt z&_~jZ)m)wx>QF6awWZnNLiTNw0mMylI?3;}gF+%HsjsNzm_eFL&aX!m;>Y0+E09g) z$i}{NaP8FDD3O*IdCEpFK$^eW%LIY2x~V~{Q^^;Q+GL|(o=1wE*>!CzFe}Zs-N(DS z8mn?$ns-+HPcp=N-)7-@cqKNWk1pn&T~<1AEWy6P7kt;CruU?|W9k~ E8_ht>=Kufz diff --git a/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_textures.zip b/public/assets/develop/data-generation/block-model/ruby_door_trapdoor_textures.zip index 06cbe60ef7a5a6b60b4e1265215cbb3bf3e4b953..303469bf09836253472149c2361b2ee5f4c3fef7 100644 GIT binary patch delta 560 zcmcb|dq!~bWoCEghoya+Wm%Rosxq^PFmM2&YMN0L0}|k6P+%x3O{$Df$u7ccN`kl9{V8sCGqh!0TmTjC#P*5N7vb$Ejl>&;Tye&7b~RHv&HWJ z7mQ+=FJp3kuU^G@JH1Z}H3~1aRBb-muUz!fslL5g%+X=_`Aec}e(k->cp&;uQ~hK$ z9@ow_uO>zqtgJQTw8&hvSl->`=A`Dv9MOOPzP3eMu1Tg9JRDwl%&5S_F@$$^Td-gh3I7tRHCk_;i o106A0l1-brn3Z8N2a~ca&_>%fkPcQhkg+U47!5QtnjORg0KTfhEdT%j delta 162 zcmX>jc#oGiz?+#xgn=?%39yKL1Dj!Obphi< zCRY%9qt{YKEk-60X1KPf?ZJxMI~f@mT7X!DL4pAWwly*^Og7}uVg{NyIgUe{`86ZM r Date: Mon, 20 Jan 2025 17:25:09 +0100 Subject: [PATCH 40/41] Changed according to its-miroma's suggestions --- develop/data-generation/block-models.md | 102 +++++++----------------- 1 file changed, 30 insertions(+), 72 deletions(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index 5b731d076..7ba6cdfb4 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -1,13 +1,14 @@ --- title: Block Model Generation -description: A guide to generating block models & blockstates via datagen. +description: A guide to generating block models and blockstates via datagen. authors: - Fellteros - natri0 - IMB11 + - its-miroma --- -# Block Model Generation {#model-generation} +# Block Model Generation {#block-model-generation} ::: info Prerequisites Make sure you've completed the [datagen setup](./setup) process first. @@ -15,8 +16,8 @@ Make sure you've completed the [datagen setup](./setup) process first. ## Setup {#setup} -First, we will need to create our ModelProvider. Create a class that `extends FabricModelProvider`. Implement both abstract methods, `generateBlockStateModels` & `generateItemModels`. -Lastly, create constructor matching super. +First, we will need to create our ModelProvider. Create a class that `extends FabricModelProvider`. Implement both abstract methods: `generateBlockStateModels` and `generateItemModels`. +Lastly, create a constructor matching super. @[code lang=java transcludeWith=:::datagen-model:provider](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) @@ -67,10 +68,14 @@ If you're stuck choosing which `TextureModel` you should use, open the `Textured @[code lang=java transcludeWith=:::datagen-model:block-texture-pool-normal](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -Another useful method is `registerCubeAllModelTexturePool`. Define the textures by passing in the "base block", and then append the "children", which will have the same textures. +Another useful method is `registerCubeAllModelTexturePool`: define the textures by passing in the "base block", and then append the "children", which will have the same textures. In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. -**_It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model._** + +::: warning +It will also generate a [simple cube all JSON model](#simple-cube-all) for the "base block" to ensure that it has a block model. + Be aware of this, if you're changing block model of this particular block, as it will result in en error. +::: You can also append a `BlockFamily`, which will generate models for all of its "children". @@ -86,24 +91,25 @@ You can also append a `BlockFamily`, which will generate models for all of its " Doors and trapdoors are a little different. Here, you have to make three new textures - two for the door, and one for the trapdoor. -1. **The door**. It has two parts - the upper half and the lower half. **Each needs its own texture:** in this case `ruby_door_top` for the upper half and `ruby_door_bottom` for the lower. -The `registerDoor()` method will create models for all orientations of the door, both open and closed. -**You also need an item texture!** Put it in `assets//textures/item/` folder. -2. **The trapdoor**. Here, you need only one texture, in this case named `ruby_trapdoor`. It will be used for all sides. -Since `TrapdoorBlock` has a `FACING` property, you can use the commented out method to generate model files with rotated textures = the trapdoor will be "orientable". -Otherwise, it will look the same no matter the direction it's facing. +1. The door: + - It has two parts - the upper half and the lower half. **Each needs its own texture:** in this case `ruby_door_top` for the upper half and `ruby_door_bottom` for the lower. + - The `registerDoor()` method will create models for all orientations of the door, both open and closed. + - **You also need an item texture!** Put it in `assets//textures/item/` folder. +2. The trapdoor: + - Here, you need only one texture, in this case named `ruby_trapdoor`. It will be used for all sides. + - Since `TrapdoorBlock` has a `FACING` property, you can use the commented out method to generate model files with rotated textures = the trapdoor will be "orientable". Otherwise, it will look the same no matter the direction it's facing. Ruby Door and Trapdoor -## Custom Block Models and Datagen Methods {#custom-models-and-methods} +## Custom Block Models {#custom-block-models} -In this section, we'll create the models for a **vertical slab block** with Oak Log textures => _Vertical Oak Log Slab_. +In this section, we'll create the models for a Vertical Oak Log Slab, with Oak Log textures. _Points 2. - 6. are declared in an inner static helper class called `CustomBlockStateModelGenerator`._ ### Custom Block Class {#custom-block-class} -Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/block-states) tutorial. `SINGLE` will indicate if there are both slabs. +Create a `VerticalSlab` block with a `FACING` property and a `SINGLE` boolean property, like in the [Block States](../blocks/blockstates) tutorial. `SINGLE` will indicate if there are both slabs. Then you should override `getOutlineShape` and `getCollisionShape`, so that the outline is rendered correctly, and the block has the correct collision shape. @[code lang=java transcludeWith=:::datagen-model-custom:voxels](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) @@ -121,54 +127,7 @@ And you're done! You can now test the block out and place it in game. Now, let's create a parent block model. It will determine the size, position in hand or other slots and the `x` and `y` coordinates of the texture. I highly recommend using [Blockbench](https://www.blockbench.net/) for this, as making it manually is a really tedious process. It should look something like this: -```json -{ - "parent": "minecraft:block/block", - "textures": { - "particle": "#side" - }, - "display": { - "gui": { - "rotation": [ 30, -135, 0 ], - "translation": [ -1.5, 0.75, 0], - "scale":[ 0.625, 0.625, 0.625 ] - }, - "firstperson_righthand": { - "rotation": [ 0, -45, 0 ], - "translation": [ 0, 2, 0], - "scale":[ 0.375, 0.375, 0.375 ] - }, - "firstperson_lefthand": { - "rotation": [ 0, 315, 0 ], - "translation": [ 0, 2, 0], - "scale":[ 0.375, 0.375, 0.375 ] - }, - "thirdperson_righthand": { - "rotation": [ 75, -45, 0 ], - "translation": [ 0, 0, 2], - "scale":[ 0.375, 0.375, 0.375 ] - }, - "thirdperson_lefthand": { - "rotation": [ 75, 315, 0 ], - "translation": [ 0, 0, 2], - "scale":[ 0.375, 0.375, 0.375 ] - } - }, - "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 8 ], - "faces": { - "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#bottom", "cullface": "down", "tintindex": 0 }, - "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north", "tintindex": 0 }, - "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "tintindex": 0 }, - "west": { "uv": [ 0, 0, 8, 16 ], "texture": "#side", "cullface": "west", "tintindex": 0 }, - "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#side", "cullface": "east", "tintindex": 0 } - } - } - ] -} -``` +@[code lang=json](@/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json) See [how blockstates are formatted](https://minecraft.wiki/w/Blockstates_definition_format) for more information. Notice the `#bottom`, `#top`, `#side` keywords. They act as variables that can be set by models that have this one as a parent: @@ -184,7 +143,7 @@ Notice the `#bottom`, `#top`, `#side` keywords. They act as variables that can b } ``` -The `bottom` value will replace the `#bottom` placeholder and so on. **Put it in the `resources/assets//models/block/` folder.** +The `bottom` value will replace the `#bottom` placeholder and so on. **Put it in the `resources/assets/mod_id/models/block/` folder.** ### Custom Model {#custom-model} @@ -192,16 +151,14 @@ Another thing we will need is an instance of the `Model` class. It will represen @[code lang=java transcludeWith=:::datagen-model-custom:model](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) -The `block()` method creates a new `Model`, pointing to the `vertical_slab.json` file inside the `resources/assets//models/block/` folder. +The `block()` method creates a new `Model`, pointing to the `vertical_slab.json` file inside the `resources/assets/mod_id/models/block/` folder. The `TextureKey`s represent the "placeholders" (`#bottom`, `#top`, ...) as an Object. ### Using Texture Map {#using-texture-map} What does `TextureMap` do? It actually provides the Identifiers that point to the textures. It technically behaves like a normal map - you associate a `TextureKey` (Key) with an `Identifier` (Value). -You can: -1. Use the Vanilla ones, e.g. `TextureMap.all()`(associates all TextureKeys with the same Identifier) or other. -2. Create a new one by creating a new instance and then using `.put()` to associate keys with values. +You can either use the vanilla ones, like `TextureMap.all()`(which associates all TextureKeys with the same Identifier), or create a new one, by creating a new instance and then using `.put()` to associate keys with values. ::: tip `TextureMap.all()` associates all TextureKeys with the same Identifier, no matter how many of them there are! @@ -217,14 +174,14 @@ The ``bottom`` and ``top`` faces will use `oak_log_top.png`, the sides will use All `TextureKey`s in the TextureMap **have to** match all `TextureKey`s in your parent block model! ::: -### Custom BlockStateSupplier Method {#custom-supplier-method} +### Custom `BlockStateSupplier` Method {#custom-supplier-method} The `BlockStateSupplier` contains all blockstate variants, their rotation, and other options like uvlock. @[code lang=java transcludeWith=:::datagen-model-custom:supplier](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) First, we create a new `VariantsBlockStateSupplier` using `VariantsBlockStateSupplier.create()`. -Then we create a new `BlockStateVariantMap` that contains parameters for all variants of the block, in this case `FACING` & `SINGLE`, and pass it into the `VariantsBlockStateSupplier`. +Then we create a new `BlockStateVariantMap` that contains parameters for all variants of the block, in this case `FACING` and `SINGLE`, and pass it into the `VariantsBlockStateSupplier`. Specify which model and which transformations (uvlock, rotation) is used when using `.register()`. For example: @@ -254,5 +211,6 @@ And that is all! Now all that's left to do is to call our method in our `ModelPr ## Sources and Links {#sources-and-links} -Other examples of using custom datagen methods have been created using [Vanilla+ Blocks](https://github.com/Fellteros/vanillablocksplus) and [Vanilla+ Verticals](https://github.com/Fellteros/vanillavsplus) mods. -You can also view the example tests in Fabric API and the Fabric docs reference mod for more information. +You can view the example tests in Fabric API and the Fabric docs reference mod for more information. + +You can also find more examples of using custom datagen methods by browsing mods' open-source code, for example [Vanilla+ Blocks](https://github.com/Fellteros/vanillablocksplus) and [Vanilla+ Verticals](https://github.com/Fellteros/vanillavsplus) by Fellteros. From 69c26df70b637405a1306a729b848c059b0e5627 Mon Sep 17 00:00:00 2001 From: Fellteros Date: Mon, 20 Jan 2025 17:58:42 +0100 Subject: [PATCH 41/41] Capitalized the PREREQUISITES title in block-models.md --- develop/data-generation/block-models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md index 7ba6cdfb4..0c6d62aab 100644 --- a/develop/data-generation/block-models.md +++ b/develop/data-generation/block-models.md @@ -10,7 +10,7 @@ authors: # Block Model Generation {#block-model-generation} -::: info Prerequisites +::: info PREREQUISITES Make sure you've completed the [datagen setup](./setup) process first. :::