diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index b301ca5..927f54f 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.21.1 2026-07-25T17:58:01.720030297 Loot Tables +// 1.21.1 2026-07-25T20:27:48.574282864 Loot Tables c5c3cbbff0b4af321ae05896dbd68e551f598c86 data/ornamentum/loot_table/blocks/amethyst_grate.json f44341b5b821a1ea423b1f9e81a020e324a3952e data/ornamentum/loot_table/blocks/ametist_bricks.json 45e380c3f67f2a7eb3eabe9364929d9b9efc5b76 data/ornamentum/loot_table/blocks/ametist_bricks_slab.json @@ -198,6 +198,7 @@ f477ebd0e0fe21e7be3e81bf4aa99a794773eb9b data/ornamentum/loot_table/blocks/red_w 1507f4311dcc09e0f57838231d41b03901f4aeb6 data/ornamentum/loot_table/blocks/smooth_basalt_bricks.json 2cbe0836062a04955c5b0e14b3e0e7d5d5d0e3d4 data/ornamentum/loot_table/blocks/smooth_basalt_bricks_slab.json 70acce0530e54306728421b99736d889bb563a52 data/ornamentum/loot_table/blocks/smooth_basalt_bricks_stairs.json +0ae7fb08472a85a9be6ac4a336f3b7224cfc92c1 data/ornamentum/loot_table/blocks/test_flag.json af3d85d2369f5d69b8cc10673bc0a408beb27025 data/ornamentum/loot_table/blocks/white_bricks.json 92732b45f3b4ad57f707c89f1dcbcbddc85a99ad data/ornamentum/loot_table/blocks/white_bricks_slab.json ac53410a3a8aa056ecf56d7b9ef369421ef53052 data/ornamentum/loot_table/blocks/white_bricks_stairs.json diff --git a/src/generated/resources/.cache/76fa529304d84db1465431f69702c7947fc3a5d2 b/src/generated/resources/.cache/76fa529304d84db1465431f69702c7947fc3a5d2 index 2d12a59..d8786f2 100644 --- a/src/generated/resources/.cache/76fa529304d84db1465431f69702c7947fc3a5d2 +++ b/src/generated/resources/.cache/76fa529304d84db1465431f69702c7947fc3a5d2 @@ -1,4 +1,4 @@ -// 1.21.1 2026-07-25T17:58:01.714460927 Block States: ornamentum +// 1.21.1 2026-07-25T20:27:48.568923238 Block States: ornamentum d6c0778339a79db4e2ec3f14d7399d1f908ce1fa assets/ornamentum/blockstates/amethyst_grate.json 7224d37e27fcaf8977fe2624b697fbb13d4b7276 assets/ornamentum/blockstates/ametist_bricks.json 8eec3960f8fa6c0c79d80fcd9abe29d5b79caf48 assets/ornamentum/blockstates/ametist_bricks_slab.json @@ -198,6 +198,7 @@ c74ade90b9173c75341ea7b88c88b4348cd8b3e2 assets/ornamentum/blockstates/red_patte b0099f1ab55f9a39bb7014d7e1b040f48a250a1c assets/ornamentum/blockstates/smooth_basalt_bricks.json 08cef6ad27d982eef0e68dc86cc56447ffa38b93 assets/ornamentum/blockstates/smooth_basalt_bricks_slab.json fe307d0ee1b3a35e0282010750b0d8eb5b90df09 assets/ornamentum/blockstates/smooth_basalt_bricks_stairs.json +b242577b5095b8190c85633f82dda51a786bcd89 assets/ornamentum/blockstates/test_flag.json 2303024183c5769915bd1421e9beb672e9f5c7c9 assets/ornamentum/blockstates/white_bricks.json 7cf7bab75d3eac5e1d459ae9d0355f1248124942 assets/ornamentum/blockstates/white_bricks_slab.json 0807a7edaa81470e71c25213df2ee57af112b907 assets/ornamentum/blockstates/white_bricks_stairs.json @@ -685,6 +686,7 @@ d8d20715fd6af3425a65d4b4cb5859a2056b8e70 assets/ornamentum/models/block/smooth_b 61def7f41d131165a4cacf75d3a51ffe8dcd0400 assets/ornamentum/models/block/smooth_basalt_bricks_stairs.json f544eaf507aace46734285d5fb163f671a32fed0 assets/ornamentum/models/block/smooth_basalt_bricks_stairs_inner.json 49359bdafe1d6cfc2ab382aae21bf7a0e97b4614 assets/ornamentum/models/block/smooth_basalt_bricks_stairs_outer.json +e5e18b18b553d15ea87737e3d90ca9cc096647ac assets/ornamentum/models/block/test_flag.json 2e59c48d33b5ce24f70ee289f8abe0702871b426 assets/ornamentum/models/block/white_bricks.json cd3a212617ff37dc8a6c30a5a97b73f0ae10c912 assets/ornamentum/models/block/white_bricks_slab.json 1b86fbb63deaf2ace17ed92e9e11ef232a254680 assets/ornamentum/models/block/white_bricks_slab_top.json @@ -932,6 +934,7 @@ c834b7fe2e386033a4963029dd558e73bc46be06 assets/ornamentum/models/item/red_wool_ 37ac053b698caa3bce55322f9a2f53c3bdde9247 assets/ornamentum/models/item/smooth_basalt_bricks.json af265ad80d8b4c2fabb0dbd1c3e478c055cace14 assets/ornamentum/models/item/smooth_basalt_bricks_slab.json 507195218a2280231f6db54aa29524a36510a4bb assets/ornamentum/models/item/smooth_basalt_bricks_stairs.json +3673542766b506d13e6af3d41991005a681cd1d5 assets/ornamentum/models/item/test_flag.json c61c7f0d652a3d13fd14c9ab83b36f0f1b68e18d assets/ornamentum/models/item/white_bricks.json 6a22d3b5c5f85d69e81c36c3367d807cfaa00970 assets/ornamentum/models/item/white_bricks_slab.json f65855f810baa06c5228a0c242a682b4cf1171a1 assets/ornamentum/models/item/white_bricks_stairs.json diff --git a/src/generated/resources/assets/ornamentum/blockstates/test_flag.json b/src/generated/resources/assets/ornamentum/blockstates/test_flag.json new file mode 100644 index 0000000..d05de00 --- /dev/null +++ b/src/generated/resources/assets/ornamentum/blockstates/test_flag.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "ornamentum:block/test_flag", + "y": 90 + }, + "facing=north": { + "model": "ornamentum:block/test_flag" + }, + "facing=south": { + "model": "ornamentum:block/test_flag", + "y": 180 + }, + "facing=west": { + "model": "ornamentum:block/test_flag", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/ornamentum/models/block/test_flag.json b/src/generated/resources/assets/ornamentum/models/block/test_flag.json new file mode 100644 index 0000000..3365f58 --- /dev/null +++ b/src/generated/resources/assets/ornamentum/models/block/test_flag.json @@ -0,0 +1,6 @@ +{ + "parent": "ornamentum:block/template_flag", + "textures": { + "2": "ornamentum:block/flags/test_flag" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/ornamentum/models/item/test_flag.json b/src/generated/resources/assets/ornamentum/models/item/test_flag.json new file mode 100644 index 0000000..9a5b991 --- /dev/null +++ b/src/generated/resources/assets/ornamentum/models/item/test_flag.json @@ -0,0 +1,3 @@ +{ + "parent": "ornamentum:block/test_flag" +} \ No newline at end of file diff --git a/src/generated/resources/data/ornamentum/loot_table/blocks/test_flag.json b/src/generated/resources/data/ornamentum/loot_table/blocks/test_flag.json new file mode 100644 index 0000000..8fb37d2 --- /dev/null +++ b/src/generated/resources/data/ornamentum/loot_table/blocks/test_flag.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "ornamentum:test_flag" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "ornamentum:blocks/test_flag" +} \ No newline at end of file diff --git a/src/main/java/ovh/glitchlabs/ornamentum/blocks/FlagBlock.java b/src/main/java/ovh/glitchlabs/ornamentum/blocks/FlagBlock.java new file mode 100644 index 0000000..8d55e37 --- /dev/null +++ b/src/main/java/ovh/glitchlabs/ornamentum/blocks/FlagBlock.java @@ -0,0 +1,64 @@ +package ovh.glitchlabs.ornamentum.blocks; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraft.world.item.context.BlockPlaceContext; + +public class FlagBlock extends HorizontalDirectionalBlock { + + private static final VoxelShape SHAPE = Shapes.or( + Block.box(7, 0, 7, 9, 16, 9) + ); + + public FlagBlock(Properties properties) { + super(properties); + + this.registerDefaultState( + this.stateDefinition.any() + .setValue(FACING, Direction.NORTH) + ); + } + + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING); + } + + + @Override + public BlockState getStateForPlacement(BlockPlaceContext context) { + return this.defaultBlockState() + .setValue(FACING, context.getHorizontalDirection().getOpposite()); + } + + + @Override + public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { + return SHAPE; + } + + + @Override + public BlockState rotate(BlockState state, Rotation rotation) { + return state.setValue( + FACING, + rotation.rotate(state.getValue(FACING)) + ); + } + + + @Override + protected com.mojang.serialization.MapCodec codec() { + return simpleCodec(FlagBlock::new); + } +} \ No newline at end of file diff --git a/src/main/java/ovh/glitchlabs/ornamentum/blocks/ModBlocks.java b/src/main/java/ovh/glitchlabs/ornamentum/blocks/ModBlocks.java index e7bb583..dc0cb44 100644 --- a/src/main/java/ovh/glitchlabs/ornamentum/blocks/ModBlocks.java +++ b/src/main/java/ovh/glitchlabs/ornamentum/blocks/ModBlocks.java @@ -16,6 +16,9 @@ public class ModBlocks { public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(Ornamentum.MODID); + public static final DeferredBlock TEST_FLAG = registerBlock("test_flag", + () -> new FlagBlock(BlockBehaviour.Properties.of().strength(1.0f))); + // Pattern Blocks public static final DeferredBlock WHITE_PATTERN_BLOCK = registerBlock("white_pattern_block", diff --git a/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockLootTableProvider.java b/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockLootTableProvider.java index 16520f3..d45f6f2 100644 --- a/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockLootTableProvider.java +++ b/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockLootTableProvider.java @@ -17,6 +17,9 @@ public class ModBlockLootTableProvider extends BlockLootSubProvider { @Override protected void generate() { + dropSelf(ModBlocks.TEST_FLAG.get()); + + dropSelf(ModBlocks.RED_PATTERN_BLOCK.get()); dropSelf(ModBlocks.RED_PATTERN_BLOCK_STAIRS.get()); dropSelf(ModBlocks.RED_PATTERN_BLOCK_SLAB.get()); diff --git a/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockStateProvider.java b/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockStateProvider.java index 0aba1da..62c886c 100644 --- a/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockStateProvider.java +++ b/src/main/java/ovh/glitchlabs/ornamentum/datagen/ModBlockStateProvider.java @@ -1,7 +1,10 @@ package ovh.glitchlabs.ornamentum.datagen; +import net.minecraft.core.Direction; import net.minecraft.data.PackOutput; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; import net.neoforged.neoforge.client.model.generators.BlockStateProvider; +import net.neoforged.neoforge.client.model.generators.ConfiguredModel; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.registries.DeferredBlock; @@ -16,6 +19,9 @@ public class ModBlockStateProvider extends BlockStateProvider { @Override protected void registerStatesAndModels() { + // FLAGS + createFlag(ModBlocks.TEST_FLAG, "test_flag"); + blockWithItem(ModBlocks.WHITE_PATTERN_BLOCK); createStairsAndSlab(ModBlocks.WHITE_PATTERN_BLOCK_STAIRS, ModBlocks.WHITE_PATTERN_BLOCK_SLAB, "white_pattern_block"); @@ -318,8 +324,41 @@ public class ModBlockStateProvider extends BlockStateProvider { simpleBlockWithItem(deferredBlock.get(), model); } - private void paneModelWithItem(DeferredBlock deferredBlock, String textureName) { - simpleBlockWithItem(deferredBlock.get(), models().withExistingParent(deferredBlock.getId().getPath(), mcLoc("block/thin_block")) - .texture("texture", modLoc("block/" + textureName))); + private void createFlag(DeferredBlock block, String textureName) { + + String name = block.getId().getPath(); + + ModelFile model = models() + .withExistingParent( + name, + modLoc("block/template_flag") + ) + .texture( + "2", + modLoc("block/flags/" + textureName) + ); + + + getVariantBuilder(block.get()) + .forAllStates(state -> { + Direction direction = state.getValue(HorizontalDirectionalBlock.FACING); + + return ConfiguredModel.builder() + .modelFile(model) + .rotationY(switch (direction) { + case NORTH -> 0; + case EAST -> 90; + case SOUTH -> 180; + case WEST -> 270; + default -> 0; + }) + .build(); + }); + + + simpleBlockItem( + block.get(), + model + ); } } \ No newline at end of file diff --git a/src/main/resources/assets/ornamentum/models/block/template_flag.json b/src/main/resources/assets/ornamentum/models/block/template_flag.json new file mode 100644 index 0000000..b4e9e62 --- /dev/null +++ b/src/main/resources/assets/ornamentum/models/block/template_flag.json @@ -0,0 +1,196 @@ +{ + "format_version": "1.9.0", + "credit": "Made with Blockbench by Ian1337", + "textures": { + "1": "minecraft:block/spruce_planks", + "2": "#flag", + "particle": "minecraft:block/spruce_planks" + }, + "elements": [ + { + "name": "top", + "from": [7, 18, 7], + "to": [9, 19, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, 0]}, + "faces": { + "north": {"uv": [6, 8, 8, 9], "texture": "#1"}, + "east": {"uv": [8, 6, 10, 7], "texture": "#1"}, + "south": {"uv": [8, 7, 10, 8], "texture": "#1"}, + "west": {"uv": [8, 8, 10, 9], "texture": "#1"}, + "up": {"uv": [10, 2, 8, 0], "texture": "#1"}, + "down": {"uv": [10, 2, 8, 4], "texture": "#1"} + } + }, + { + "name": "up", + "from": [7.5, 4, 7.5], + "to": [8.5, 18, 8.5], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 0, -0.5]}, + "faces": { + "north": {"uv": [0, 0, 1, 14], "texture": "#1"}, + "east": {"uv": [1, 0, 2, 14], "texture": "#1"}, + "south": {"uv": [2, 0, 3, 14], "texture": "#1"}, + "west": {"uv": [3, 0, 4, 14], "texture": "#1"}, + "up": {"uv": [7, 10, 6, 9], "texture": "#1"}, + "down": {"uv": [8, 9, 7, 10], "texture": "#1"} + } + }, + { + "name": "down", + "from": [7, 0, 7], + "to": [9, 4, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, -12, 0]}, + "faces": { + "north": {"uv": [4, 0, 6, 4], "texture": "#1"}, + "east": {"uv": [4, 4, 6, 8], "texture": "#1"}, + "south": {"uv": [6, 0, 8, 4], "texture": "#1"}, + "west": {"uv": [6, 4, 8, 8], "texture": "#1"}, + "up": {"uv": [6, 10, 4, 8], "texture": "#1"}, + "down": {"uv": [10, 4, 8, 6], "texture": "#1"} + } + }, + { + "name": "Flag1", + "from": [3.5, 9, 8.25], + "to": [7.5, 18, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 0, -0.75]}, + "faces": { + "north": {"uv": [0, 0, 4, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [4, 0, 0, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + }, + { + "name": "Flag1_2", + "from": [3.5, 9, 7.75], + "to": [7.5, 18, 7.75], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 0, -1.25]}, + "faces": { + "north": {"uv": [0, 0, 4, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [0, 0, 4, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + }, + { + "name": "Flag2", + "from": [-0.5, 9, 8], + "to": [3.5, 18, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [1.5, 0, -1]}, + "faces": { + "north": {"uv": [4, 0, 8, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [8, 0, 4, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + }, + { + "name": "Flag3", + "from": [-4.5, 9, 8.25], + "to": [-0.5, 18, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [-2.5, 0, -0.75]}, + "faces": { + "north": {"uv": [8, 0, 12, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [12, 0, 8, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + }, + { + "name": "Flag3_2", + "from": [-4.5, 9, 7.75], + "to": [-0.5, 18, 7.75], + "rotation": {"angle": 0, "axis": "y", "origin": [-2.5, 0, -1.25]}, + "faces": { + "north": {"uv": [8, 0, 12, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [8, 0, 12, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + }, + { + "name": "Flag4", + "from": [-8.5, 9, 8], + "to": [-4.5, 18, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [-6.5, 0, -1]}, + "faces": { + "north": {"uv": [12, 0, 16, 9], "texture": "#2"}, + "east": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "south": {"uv": [16, 0, 12, 9], "texture": "#2"}, + "west": {"uv": [0, 0, 0, 9], "texture": "#2"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#2"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#2"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [0, -59, 0], + "translation": [0, 3.75, 1.75], + "scale": [0.75, 0.75, 0.75] + }, + "thirdperson_lefthand": { + "rotation": [0, 59, 0], + "translation": [0, 3.75, 1.75], + "scale": [0.75, 0.75, 0.75] + }, + "firstperson_righthand": { + "rotation": [-124.29, -82.79, -90.44], + "translation": [2.5, 4.25, 0], + "scale": [0.75, 0.75, 0.75] + }, + "firstperson_lefthand": { + "rotation": [-17.81, 88.48, -7.82], + "translation": [2.5, 4.25, 0], + "scale": [0.75, 0.75, 0.75] + }, + "ground": { + "rotation": [-27.16, 17.05, 13.6], + "translation": [0, 3.25, 0], + "scale": [0.75, 0.75, 0.75] + }, + "gui": { + "rotation": [28.96, -37.02, 18.48], + "translation": [4.5, -1.5, 0], + "scale": [0.75, 0.75, 0.75] + }, + "head": { + "rotation": [1.5, 1, 18.75], + "translation": [-8, 5.75, 0] + }, + "fixed": { + "translation": [7.25, -1.75, -0.5] + }, + "on_shelf": { + "rotation": [22.75, 90, 0], + "translation": [0, 0, -1.25] + } + }, + "groups": [ + { + "name": "flag_pol", + "origin": [6.5, 0, -0.5], + "scope": 0, + "color": 0, + "children": [0, 1, 2] + }, + { + "name": "Flag", + "origin": [6.5, 0, -0.5], + "scope": 0, + "color": 0, + "children": [3, 4, 5, 6, 7, 8] + } + ] +} diff --git a/src/main/resources/assets/ornamentum/textures/block/flags/test_flag.png b/src/main/resources/assets/ornamentum/textures/block/flags/test_flag.png new file mode 100644 index 0000000..f829654 Binary files /dev/null and b/src/main/resources/assets/ornamentum/textures/block/flags/test_flag.png differ