From 26e2c519392f15d81cd20b6bfa073b2727ec781f Mon Sep 17 00:00:00 2001 From: Fellteros <144528463+Fellteros@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:06:34 +0100 Subject: [PATCH] Block Model Generation/Datagen (#268) --- .vitepress/sidebars/develop.ts | 6 +- develop/data-generation/block-models.md | 216 ++++++++++++++++++ .../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 .../block-model/ruby_block.png | Bin 0 -> 393 bytes .../block-model/ruby_block_big.png | Bin 0 -> 846 bytes .../data-generation/block-model/ruby_door.png | Bin 0 -> 315 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 -> 1812 bytes .../ruby_door_trapdoor_textures.zip | Bin 0 -> 2252 bytes .../block-model/ruby_trapdoor.png | Bin 0 -> 393 bytes .../block-model/ruby_trapdoor_big.png | Bin 0 -> 393 bytes .../block-model/steel_block.png | Bin 0 -> 1198 bytes .../block-model/steel_block_big.png | Bin 0 -> 1300 bytes .../FabricDocsReferenceDataGenerator.java | 2 + ...abricDocsReferenceEnglishLangProvider.java | 10 + .../FabricDocsReferenceModelProvider.java | 157 +++++++++++++ .../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 + .../fabric-docs-reference/lang/en_us.json | 9 + .../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 + .../com/example/docs/block/ModBlocks.java | 79 +++++++ .../docs/block/custom/VerticalSlabBlock.java | 131 +++++++++++ .../java/com/example/docs/item/ModItems.java | 1 - .../models/block/vertical_slab.json | 174 ++++++++++++++ .../textures/block/pipe_block.png | Bin 0 -> 130 bytes .../textures/block/pipe_block_top.png | Bin 0 -> 221 bytes .../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 .../textures/item/ruby_door.png | Bin 0 -> 315 bytes sidebar_translations.json | 1 + 76 files changed, 1515 insertions(+), 2 deletions(-) create mode 100644 develop/data-generation/block-models.md 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.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 create mode 100644 reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java 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/java/com/example/docs/block/custom/VerticalSlabBlock.java create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json 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/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 create mode 100644 reference/latest/src/main/resources/assets/fabric-docs-reference/textures/item/ruby_door.png diff --git a/.vitepress/sidebars/develop.ts b/.vitepress/sidebars/develop.ts index 4a50e1c65..d9efb8e3c 100644 --- a/.vitepress/sidebars/develop.ts +++ b/.vitepress/sidebars/develop.ts @@ -235,7 +235,11 @@ export default [ { text: "develop.dataGeneration.lootTables", link: "/develop/data-generation/loot-tables" - } + }, + { + text: "develop.dataGeneration.blockModels", + link: "/develop/data-generation/block-models" + } ] }, { diff --git a/develop/data-generation/block-models.md b/develop/data-generation/block-models.md new file mode 100644 index 000000000..cb6fe44d7 --- /dev/null +++ b/develop/data-generation/block-models.md @@ -0,0 +1,216 @@ +--- +title: Block Model Generation +description: A guide to generating block models and blockstates via datagen. +authors: + - Fellteros + - natri0 + - IMB11 + - its-miroma +--- + +# Block Model Generation {#block-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 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) + +Register this class in your `DataGeneratorEntrypoint` within the `onInitializeDataGenerator` method. + +## Blockstates and Block Models {#blockstates-and-block-models} + +```java +@Override +public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { +} +``` + +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) + +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) + +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. + +@[code lang=java transcludeWith=:::datagen-model:cube-top-for-ends](@/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java) + +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)! +::: + +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. +In this case, we passed in the `RUBY_BLOCK`, so the stairs, slab and fence will use the `RUBY_BLOCK` texture. + +::: 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". + +@[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) + +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. + +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 {#custom-block-models} + +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/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) + +@[code lang=java transcludeWith=:::datagen-model-custom:collision](@/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java) + +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) + +And you're done! You can now test the block out and place it in 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. +It's recommended to use an editor such as [Blockbench](https://www.blockbench.net/) for this, as making it manually is a really tedious process. It should look something like this: + +@[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: + +```json +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "bottom": "minecraft:block/sandstone_bottom", + "side": "minecraft:block/sandstone", + "top": "minecraft:block/sandstone_top" + } +} +``` + +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} + +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/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 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! +::: + +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 `VariantsBlockStateSupplier.create()`. +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: + +- 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 generator`, 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) + +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`: + +@[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} + +You can view the example tests in [Fabric API](https://github.com/FabricMC/fabric/blob/1.21.4/fabric-data-generation-api-v1/src/) and this documentation's [Reference Mod](https://github.com/FabricMC/fabric-docs/tree/main/reference) 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. 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.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_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&Psbn6YmBh8b9HwB0000h)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 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..303469bf09836253472149c2361b2ee5f4c3fef7 GIT binary patch literal 2252 zcmWIWW@Zs#-~htVSfeNgBp}G3z))10R2g4Vlvt3GpI@X`ke6Os!Og(P0#XGgLPK~N z*cZ2Ur#~$1OIP^Plg`-5SoW_oz|WnRONtAqir3S_B?w3hfG`Iekd*)YKM_bV76-XI zF|0c$^AgB*_H=O!vFM#Ud4JZS0Fh($YSSNFQ1xEN`GqlNiqkZQ@Z)}V(eevtmuu)b zg*yr?+*;e75fkIOs?6h@X?XI&ztdEn&nw<%e`kwZiT@vARz|J|i9aezD`x0^*nGu~ zF)WS8VagGPJvkve86MpAS+99!N)towc_)TxKPNgqVw}Rwx0#h;?~>e`OZJ@%KX*=} zv+{KRw`j(v6J|b2&upG_;iJupdw+FWulH|mwR$zP!^+-!=8Vdv9@8sVR9|=&Tc^8j zUhbdBUgdc^a1q1oH9E6qR9@9Htqoq-^r`4Yjk`^a65H#&e2HS4_@ejiSZune`qhTi zpWNQUY@N^lanIVz`^xC$>8L43zNu}S_j10O)(_#`3cv1sW>&e}EVNWoYXvZD89ZJ6 zT-G@yGzECGbEK&Y*Y+_oFmwWO06el)(@-Ou7Z%z0BHCQ$V#)BChgqwrEo)#ju9 z%0(}o>f4*e937UQza+Zm*WSB~2crKpO;+P^?OgL}VuZoUS~E_I%tedk-Cb@@YHrLC z4G7?CTeRhx1gnUn<;>9{T1b5V)IGV;ATlP*)_)m!_b7V=&b+h=C| zWA>iR+A#Kp(o}Oxju#x37azR5CvEfKd-KyGH;3A*%Ig`dv}9C&{C(KYAcpv4ydkVx*c8gUfKi)E9l&-PcYw_$#MppD93zq(}p622w_B^}3i*Wq% zQcC<1-f$(OWMctWi>0a63SONrfwwPd&Jf$|5Se>Ak-H&y!sS1!1YOgezZB}#$~&^v zE#9_jW$wv7!)THGt9A*~jx~!VRPZrz^LBE3JYy)3Y`?A0;{AWuUxg2(GOuWkC&hPz_Q{DSA&N( z!@S!I)EO$wXP*{Kb9VNyd2^Ogl}{&R_UiT6vJj_ez%Xb*$2x)WjAA`qlGqtj$}MYVRn+U4D`lC-|Le5iW!_D485yTf1uB^PZz?bnV4c)@%2;Ww4C~_sPwPLt zameWr<=E*X=5(GfpX>48Tf1&u^gk|tKD%ebmg3TK^mz7Vo4p4S&x}kW%!tYrxg-{3 zkN{}~gKdo5>%)o8wo0YkW;G& zijf`6NJio-jDRMC3L|8bL8%=%d{D!nm=)P%TxlO@EGX>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 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/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 } } 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..ef9bf23ce --- /dev/null +++ b/reference/latest/src/client/java/com/example/docs/datagen/FabricDocsReferenceModelProvider.java @@ -0,0 +1,157 @@ +package com.example.docs.datagen; + +import java.util.Optional; + +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 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; + +// :::datagen-model:provider +public class FabricDocsReferenceModelProvider extends FabricModelProvider { + public FabricDocsReferenceModelProvider(FabricDataOutput output) { + super(output); + } + + @Override + 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 generator, Block vertSlabBlock, Block fullBlock, TextureMap textures) { + Identifier slabModel = VERTICAL_SLAB.upload(vertSlabBlock, textures, generator.modelCollector); + Identifier fullBlockModel = ModelIds.getBlockModelId(fullBlock); + generator.blockStateCollector.accept(createVerticalSlabBlockStates(vertSlabBlock, slabModel, fullBlockModel)); + generator.registerParentedItemModel(vertSlabBlock, slabModel); + } + + // :::datagen-model-custom:gen + } + + // :::datagen-model:provider + @Override + public String getName() { + return "FabricDocsReference Model Provider"; + } +} +// :::datagen-model:provider 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/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", 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/java/com/example/docs/block/ModBlocks.java b/reference/latest/src/main/java/com/example/docs/block/ModBlocks.java index d503a9bb8..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,8 +1,19 @@ package com.example.docs.block; +import java.util.function.Function; + +import org.jetbrains.annotations.NotNull; + 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.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; @@ -18,6 +29,7 @@ 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; // :::1 @@ -84,6 +96,45 @@ 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()); + + // :::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) { // Sometimes, you may not want to register an item for the block. @@ -101,6 +152,27 @@ 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 +189,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); }); } 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..f980dc142 --- /dev/null +++ b/reference/latest/src/main/java/com/example/docs/block/custom/VerticalSlabBlock.java @@ -0,0 +1,131 @@ +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; +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.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; + +// :::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 + + // :::datagen-model-custom:constructor +} +// :::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 0a87c31d7..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,7 +108,6 @@ public class ModItems { SUSPICIOUS_SUBSTANCE_KEY ); // :::2 - // :::1 public static Item register(Item item, RegistryKey registryKey) { // Register the item. 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..dc98651c3 --- /dev/null +++ b/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/vertical_slab.json @@ -0,0 +1,174 @@ +{ + "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 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$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`%+LeOsPx#^+`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/sidebar_translations.json b/sidebar_translations.json index 23dd41fc7..9965a6e85 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.blockModels": "Block Model Generation", "develop.rendering": "Rendering", "develop.rendering.basicConcepts": "Basic Rendering Concepts", "develop.rendering.drawContext": "Using the Drawing Context",