Skip to content

Commit

Permalink
✨ white marble railing slant
Browse files Browse the repository at this point in the history
Signed-off-by: LocusAzzurro <[email protected]>
  • Loading branch information
LocusAzzurro committed Jul 30, 2023
1 parent 8673cbf commit 65d5dc0
Show file tree
Hide file tree
Showing 12 changed files with 510 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ bcd76e15f83394c60485fc5da88f93334190030c assets/ultramarine/blockstates/white_an
276d5d5768b6538d7ad950770db28dc8ceefa4ad assets/ultramarine/blockstates/white_and_pink_mixed_bricks.json
35cf36a16bc01b9e0cd3e0f8dcf60f9b3117948d assets/ultramarine/blockstates/white_landscape_painting.json
19883f55d7c1c103e969b07ebe0be13b4f18da56 assets/ultramarine/blockstates/white_marble_railing.json
6bcba48e0f72c2537889daf215fa8218c808b6cd assets/ultramarine/blockstates/white_marble_railing_slant.json
b66c252d8eb3ca732e2547df094d5382b531717a assets/ultramarine/blockstates/white_sky_lantern.json
6f5aad7deb01f9c52147c815a4ed692b201fa2d0 assets/ultramarine/blockstates/wine_pot.json
dedd81b698439455174cf46762a93f554192a135 assets/ultramarine/blockstates/wooden_crate.json
Expand Down Expand Up @@ -1062,6 +1063,7 @@ f34e99cdee9f3ffbd5feb625700d01230ddf40c2 assets/ultramarine/models/item/white_an
100469fcfca0e98bd183c3614956f7a2b3cded13 assets/ultramarine/models/item/white_and_pink_mixed_bricks.json
91a25fcb76d4dd2209445059a5eaec3f4607d018 assets/ultramarine/models/item/white_landscape_painting.json
a28bb0f835383bd8c4f2879799c97ed948e9576a assets/ultramarine/models/item/white_marble_railing.json
b710fe161e0364dddda59d46fc8f32b494e4fda7 assets/ultramarine/models/item/white_marble_railing_slant.json
ba8736149c1499636d5f167a65b662e22f63f1fa assets/ultramarine/models/item/white_sky_lantern.json
fc02586cd5f6edee1e1285adf33ffc2b7b9793b3 assets/ultramarine/models/item/wine_pot.json
1237f2932da7cd261f890a84bf48199820cf8ec5 assets/ultramarine/models/item/wooden_crate.json
Expand Down Expand Up @@ -1103,7 +1105,7 @@ e48e56ce7a08d5506893c975360626e425e808ea assets/ultramarine/models/item/yellow_s
bb3cff8ef2b03825fc5bbeffb336436d70edcaa4 data/minecraft/tags/blocks/fences.json
df119d17bd816bf69c1e9b2e52f1d091ac36f1e0 data/minecraft/tags/blocks/mineable/axe.json
133ea1a4ce05c3a4696a95395d626b3e0d5e861e data/minecraft/tags/blocks/mineable/hoe.json
11106f2b0f9907494141704bf3efd46307938e69 data/minecraft/tags/blocks/mineable/pickaxe.json
32a45e6c4f762f0f6c77ca5fb950f5ee57ba81b1 data/minecraft/tags/blocks/mineable/pickaxe.json
17545dd0c9613eb0477c89b2b64307a497bc1d58 data/minecraft/tags/blocks/needs_iron_tool.json
9a78734519a787b16bc1a768f35bcbf3e480d116 data/minecraft/tags/blocks/needs_stone_tool.json
3186ba1b362c329daa8cf80a8536319b79fa838a data/minecraft/tags/blocks/planks.json
Expand Down Expand Up @@ -1567,6 +1569,7 @@ f8beec2248ef9e88ac4f92bc14c1aec25e0e67a6 data/ultramarine/loot_tables/blocks/whi
802044aa465ce945186c49ae0c8f0cb304dbd9df data/ultramarine/loot_tables/blocks/white_and_pink_mixed_bricks.json
f3a4bcf8240c554b43209fffefc87cc6dbce744f data/ultramarine/loot_tables/blocks/white_landscape_painting.json
0d4f5680ed09decf6bcc5e27c5233dee7aff8ae8 data/ultramarine/loot_tables/blocks/white_marble_railing.json
a316b9524277bdbbc572544584fd1f55ea3eda9c data/ultramarine/loot_tables/blocks/white_marble_railing_slant.json
a6bec953a4b043cadd1b292e2dd5eb17fde8ed65 data/ultramarine/loot_tables/blocks/white_sky_lantern.json
4cd659e1c0375848a336ae6879eda315d0f43cc6 data/ultramarine/loot_tables/blocks/wine_pot.json
ebfdc12d19eb9ee8ea6f96ff884c78def322a3dc data/ultramarine/loot_tables/blocks/wooden_crate.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"variants": {
"facing=north,shifted=false,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant_shifted"
},
"facing=south,shifted=false,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 180
},
"facing=west,shifted=false,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 270
},
"facing=east,shifted=false,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 90
},
"facing=north,shifted=true,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant"
},
"facing=south,shifted=true,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 180
},
"facing=west,shifted=true,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 270
},
"facing=east,shifted=true,waterlogged=false": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 90
},
"facing=north,shifted=false,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant_shifted"
},
"facing=south,shifted=false,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 180
},
"facing=west,shifted=false,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 270
},
"facing=east,shifted=false,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant_shifted",
"y": 90
},
"facing=north,shifted=true,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant"
},
"facing=south,shifted=true,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 180
},
"facing=west,shifted=true,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 270
},
"facing=east,shifted=true,waterlogged=true": {
"model": "ultramarine:block/white_marble_railing_slant",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ultramarine:block/white_marble_railing_slant"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"ultramarine:carved_red_pillar_base",
"ultramarine:carved_red_pillar_head",
"ultramarine:white_marble_railing",
"ultramarine:white_marble_railing_slant",
"ultramarine:carved_stone_panel_edge",
"ultramarine:carved_stone_queti_part",
"ultramarine:carved_stone_beam",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:block",
"pools": [
{
"name": "white_marble_railing_slant",
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "ultramarine:white_marble_railing_slant"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class BlockRegistry {
public static final RegistryObject<Block> DARK_OAK_RAFTER = BLOCKS.register("dark_oak_rafter", () -> new Rafter(BaseBlockProperty.WOOD));
public static final RegistryObject<Block> DARK_OAK_RAFTER_END = BLOCKS.register("dark_oak_rafter_end", () -> new RafterEnd(BaseBlockProperty.WOOD));
public static final RegistryObject<Block> WHITE_MARBLE_RAILING = BLOCKS.register("white_marble_railing", () -> new RailingBlock(BaseBlockProperty.MARBLE));
public static final RegistryObject<Block> WHITE_MARBLE_RAILING_SLANT = BLOCKS.register("white_marble_railing_slant", () -> new RailingSlant(BaseBlockProperty.MARBLE, 4));
public static final RegistryObject<Block> RED_CARVED_WOOD = BLOCKS.register("red_carved_wood", () -> new BaseBlock(BaseBlockProperty.WOOD));
public static final RegistryObject<Block> RED_CARVED_WOODEN_SLAB = BLOCKS.register("red_carved_wooden_slab", () -> new BaseSlab(BaseBlockProperty.WOOD));
public static final RegistryObject<Block> RED_CARVED_WOODEN_STAIRS = BLOCKS.register("red_carved_wooden_stairs", () -> new StraightStairBlock(BaseBlockProperty.WOOD));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class ItemRegistry {
public static final RegistryObject<Item> DARK_OAK_RAFTER = fromBlock(BlockRegistry.DARK_OAK_RAFTER, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> DARK_OAK_RAFTER_END = fromBlock(BlockRegistry.DARK_OAK_RAFTER_END, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> WHITE_MARBLE_RAILING = fromBlock(BlockRegistry.WHITE_MARBLE_RAILING, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> WHITE_MARBLE_RAILING_SLANT = fromBlock(BlockRegistry.WHITE_MARBLE_RAILING_SLANT, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> RED_CARVED_WOOD = fromBlock(BlockRegistry.RED_CARVED_WOOD, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> RED_CARVED_WOODEN_SLAB = fromBlock(BlockRegistry.RED_CARVED_WOODEN_SLAB, ModCreativeTab.DECORATIVE_BLOCKS);
public static final RegistryObject<Item> RED_CARVED_WOODEN_STAIRS = fromBlock(BlockRegistry.RED_CARVED_WOODEN_STAIRS, ModCreativeTab.DECORATIVE_BLOCKS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ protected void registerStatesAndModels() {
vegetableBasket((StackableHalfBlock) BlockRegistry.PEAR_BASKET.get());

BlockRegistry.BLOCKS.getEntries().stream().filter(blockRegistryObject -> blockRegistryObject.get() instanceof SideAxialBlock)
.forEach(sideAxial -> horizontalBlockNoOffset(sideAxial.get()));
.forEach(sideAxial -> {
SideAxialBlock block = (SideAxialBlock) sideAxial.get();
if (block instanceof RailingSlant) shiftedHorizontalBlockNoOffset(block);
else horizontalBlockNoOffset(sideAxial.get());
});

BlockRegistry.BLOCKS.getEntries().stream().filter(blockRegistryObject -> blockRegistryObject.get() instanceof CentralAxialBlock)
.forEach(centralAxial -> axisBlock(centralAxial.get()));
Expand Down Expand Up @@ -560,6 +564,13 @@ private void horizontalBlockNoOffset(Block block){
horizontalBlock(block, models().getExistingFile(modLoc(BLOCK + name(block))), 0);
}

private void shiftedHorizontalBlockNoOffset(Block block){
horizontalBlock(block, state -> {
Boolean shifted = state.getValue(SHIFTED);
return shifted ? models().getExistingFile(modLoc(BLOCK + name(block))) : models().getExistingFile(modLoc(BLOCK + name(block) + "_shifted"));
});
}

private void directionalSideBottomTop(Block block, ResourceLocation side, ResourceLocation bottom, ResourceLocation top){
String blockName = Objects.requireNonNull(block.getRegistryName()).getPath();
var model = models().cubeBottomTop(blockName, side, bottom, top);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.voxelutopia.ultramarine.world.block;

import com.voxelutopia.ultramarine.world.block.state.ModBlockStateProperties;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;

public class RailingSlant extends SideAxialBlock{

public static final BooleanProperty SHIFTED = ModBlockStateProperties.SHIFTED;
public RailingSlant(BaseBlockProperty property, int thickness) {
super(property, thickness, 16, true);
BlockState state = this.stateDefinition.any()
.setValue(SHIFTED, Boolean.FALSE);
this.registerDefaultState(state);
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
super.createBlockStateDefinition(pBuilder);
pBuilder.add(SHIFTED);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"6": "ultramarine:block/white_marble_railing_slant",
"particle": "block/quartz_block_bottom"
},
"elements": [
{
"from": [7.5, 18, 4],
"to": [8.5, 20, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [9.5, 3.25, 9.75, 3.75], "texture": "#6"},
"east": {"uv": [3, 8.75, 3.5, 9.25], "texture": "#6"},
"south": {"uv": [6, 9, 6.25, 9.5], "texture": "#6"},
"west": {"uv": [3.75, 8.75, 4.25, 9.25], "texture": "#6"},
"up": {"uv": [4, 9.75, 3.5, 9.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [10, 4, 9.5, 4.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7, 8, 0],
"to": [9, 18, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [2.5, 6, 3, 8.5], "texture": "#6"},
"east": {"uv": [5, 0, 6.5, 2.5], "texture": "#6"},
"south": {"uv": [1.75, 6, 2.25, 8.5], "texture": "#6"},
"west": {"uv": [5, 2.75, 6.5, 5.25], "texture": "#6"},
"up": {"uv": [9.25, 3, 7.75, 2.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [9.25, 3.25, 7.75, 3.75], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7, 21, 0],
"to": [9, 23, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [5.25, 9, 5.75, 9.5], "texture": "#6"},
"east": {"uv": [7.75, 4, 9.25, 4.5], "texture": "#6"},
"south": {"uv": [4.5, 9, 5, 9.5], "texture": "#6"},
"west": {"uv": [7.75, 4.75, 9.25, 5.25], "texture": "#6"},
"up": {"uv": [9.25, 6, 7.75, 5.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [9.25, 6.25, 7.75, 6.75], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7.25, 20, 3],
"to": [8.75, 21, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [9.5, 5, 10, 5.25], "texture": "#6"},
"east": {"uv": [1.5, 9.5, 2.25, 9.75], "texture": "#6"},
"south": {"uv": [9.5, 4.5, 10, 4.75], "texture": "#6"},
"west": {"uv": [9.5, 2.25, 10.25, 2.5], "texture": "#6"},
"up": {"uv": [9.25, 9, 8.5, 8.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [0.75, 8.75, 0, 9.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7.5, 10, 10],
"to": [8.5, 12, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [9.5, 6.25, 9.75, 6.75], "texture": "#6"},
"east": {"uv": [8.5, 9.25, 9, 9.75], "texture": "#6"},
"south": {"uv": [9.5, 5.5, 9.75, 6], "texture": "#6"},
"west": {"uv": [9.25, 9.25, 9.75, 9.75], "texture": "#6"},
"up": {"uv": [7, 9.75, 6.5, 9.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [10, 7, 9.5, 7.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7, 0, 10],
"to": [9, 10, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [4, 6, 4.5, 8.5], "texture": "#6"},
"east": {"uv": [5, 5.5, 6.5, 8], "texture": "#6"},
"south": {"uv": [3.25, 6, 3.75, 8.5], "texture": "#6"},
"west": {"uv": [0, 6, 1.5, 8.5], "texture": "#6"},
"up": {"uv": [9.25, 7.5, 7.75, 7], "rotation": 90, "texture": "#6"},
"down": {"uv": [9.25, 7.75, 7.75, 8.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7, 13, 10],
"to": [9, 15, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [0.75, 9.5, 1.25, 10], "texture": "#6"},
"east": {"uv": [8, 0, 9.5, 0.5], "texture": "#6"},
"south": {"uv": [0, 9.5, 0.5, 10], "texture": "#6"},
"west": {"uv": [8, 0.75, 9.5, 1.25], "texture": "#6"},
"up": {"uv": [9.5, 2, 8, 1.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [6.25, 8.25, 4.75, 8.75], "rotation": 270, "texture": "#6"}
}
},
{
"from": [7.25, 12, 10],
"to": [8.75, 13, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [9.5, 7.5, 10, 7.75], "texture": "#6"},
"east": {"uv": [2.5, 9.5, 3.25, 9.75], "texture": "#6"},
"south": {"uv": [7.25, 9.5, 7.75, 9.75], "texture": "#6"},
"west": {"uv": [9.5, 2.75, 10.25, 3], "texture": "#6"},
"up": {"uv": [1.75, 9.25, 1, 8.75], "rotation": 90, "texture": "#6"},
"down": {"uv": [2.75, 8.75, 2, 9.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [6, 0, 6],
"to": [10, 23, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 7, 8]},
"faces": {
"north": {"uv": [3.75, 0, 4.75, 5.75], "texture": "#6"},
"east": {"uv": [0, 0, 1, 5.75], "texture": "#6"},
"south": {"uv": [1.25, 0, 2.25, 5.75], "texture": "#6"},
"west": {"uv": [2.5, 0, 3.5, 5.75], "texture": "#6"},
"up": {"uv": [7.75, 1, 6.75, 0], "rotation": 90, "texture": "#6"},
"down": {"uv": [7.75, 1.25, 6.75, 2.25], "rotation": 270, "texture": "#6"}
}
},
{
"from": [6.5, 23, 6.5],
"to": [9.5, 28, 9.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
"faces": {
"north": {"uv": [6.75, 7, 7.5, 8.25], "texture": "#6"},
"east": {"uv": [6.75, 2.5, 7.5, 3.75], "texture": "#6"},
"south": {"uv": [6.75, 4, 7.5, 5.25], "texture": "#6"},
"west": {"uv": [6.75, 5.5, 7.5, 6.75], "texture": "#6"},
"up": {"uv": [7.25, 9.25, 6.5, 8.5], "rotation": 90, "texture": "#6"},
"down": {"uv": [8.25, 8.5, 7.5, 9.25], "rotation": 270, "texture": "#6"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"translation": [0, 1.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"translation": [0, 1.5, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 225, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, -135, 0],
"translation": [0, -2, 0],
"scale": [0.5, 0.5, 0.5]
}
},
"groups": [
{
"name": "栏杆本体",
"origin": [0, 0, 0],
"color": 0,
"children": [
0,
1,
2,
3,
{
"name": "栏杆本体",
"origin": [0, 0, 0],
"color": 0,
"children": [4, 5, 6, 7]
},
8,
9
]
}
]
}
Loading

0 comments on commit 65d5dc0

Please sign in to comment.