feat: model and textures for RS block

This commit is contained in:
xtex 2023-07-28 16:51:38 +08:00
parent 2e9fd2f05d
commit f5fd65aee8
Signed by: xtex
GPG Key ID: B918086ED8045B91
8 changed files with 177 additions and 545 deletions

View File

@ -3,6 +3,7 @@ package quaedam.misc.reality
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.block.* import net.minecraft.world.level.block.*
@ -12,6 +13,9 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.material.FluidState import net.minecraft.world.level.material.FluidState
import net.minecraft.world.level.material.Fluids import net.minecraft.world.level.material.Fluids
import net.minecraft.world.level.material.MapColor import net.minecraft.world.level.material.MapColor
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
object RSBlock : HorizontalDirectionalBlock( object RSBlock : HorizontalDirectionalBlock(
Properties.of() Properties.of()
@ -21,6 +25,12 @@ object RSBlock : HorizontalDirectionalBlock(
.mapColor(MapColor.COLOR_BLUE) .mapColor(MapColor.COLOR_BLUE)
), EntityBlock, SimpleWaterloggedBlock { ), EntityBlock, SimpleWaterloggedBlock {
val shape = Shapes.or(
box(1.0, 0.0, 1.0, 15.0, 1.0, 15.0),
box(0.0, 1.0, 0.0, 16.0, 14.0, 16.0),
box(1.0, 14.0, 1.0, 15.0, 15.0, 15.0),
)
init { init {
registerDefaultState( registerDefaultState(
defaultBlockState() defaultBlockState()
@ -41,6 +51,9 @@ object RSBlock : HorizontalDirectionalBlock(
return super.defaultBlockState().setValue(FACING, context.horizontalDirection) return super.defaultBlockState().setValue(FACING, context.horizontalDirection)
} }
@Suppress("OVERRIDE_DEPRECATION", "DEPRECATION")
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext) = shape
@Suppress("OVERRIDE_DEPRECATION", "DEPRECATION") @Suppress("OVERRIDE_DEPRECATION", "DEPRECATION")
override fun updateShape( override fun updateShape(
state: BlockState, state: BlockState,

View File

@ -1,19 +1,19 @@
{ {
"variants": { "variants": {
"facing=east": { "facing=east": {
"model": "quaedam:block/causality_anchor", "model": "quaedam:block/reality_stabler",
"y": 270 "y": 270
}, },
"facing=south": { "facing=south": {
"model": "quaedam:block/causality_anchor", "model": "quaedam:block/reality_stabler",
"y": 0 "y": 0
}, },
"facing=west": { "facing=west": {
"model": "quaedam:block/causality_anchor", "model": "quaedam:block/reality_stabler",
"y": 90 "y": 90
}, },
"facing=north": { "facing=north": {
"model": "quaedam:block/causality_anchor", "model": "quaedam:block/reality_stabler",
"y": 180 "y": 180
} }
} }

View File

@ -1,541 +1,106 @@
{ {
"parent": "minecraft:block/block", "parent": "minecraft:block/block",
"texture_size": [ "texture_size": [64, 64],
64, "textures": {
64 "0": "quaedam:block/causality_anchor",
], "particle": "quaedam:block/causality_anchor"
"textures": { },
"0": "quaedam:block/causality_anchor", "elements": [
"particle": "quaedam:block/causality_anchor" {
}, "name": "s2",
"elements": [ "from": [13, -6, 14],
{ "to": [15, 6, 16],
"name": "s2", "rotation": {"angle": -22.5, "axis": "x", "origin": [-1, 0, 0]},
"from": [ "faces": {
13, "north": {"uv": [4, 4, 4.5, 7], "texture": "#0"},
-6, "east": {"uv": [4.5, 4, 5, 7], "texture": "#0"},
14 "south": {"uv": [0, 5, 0.5, 8], "texture": "#0"},
], "west": {"uv": [0.5, 5, 1, 8], "texture": "#0"},
"to": [ "up": {"uv": [5.75, 7.5, 5.25, 7], "texture": "#0"},
15, "down": {"uv": [7.5, 5.5, 7, 6], "texture": "#0"}
6, }
16 },
], {
"rotation": { "name": "s3",
"angle": -22.5, "from": [1, -6, 14],
"axis": "x", "to": [3, 6, 16],
"origin": [ "rotation": {"angle": -22.5, "axis": "x", "origin": [1, 0, 0]},
-1, "faces": {
0, "north": {"uv": [1, 5, 1.5, 8], "texture": "#0"},
0 "east": {"uv": [1.5, 5, 2, 8], "texture": "#0"},
] "south": {"uv": [2, 5, 2.5, 8], "texture": "#0"},
}, "west": {"uv": [2.5, 5, 3, 8], "texture": "#0"},
"faces": { "up": {"uv": [6.25, 7.5, 5.75, 7], "texture": "#0"},
"north": { "down": {"uv": [7.5, 6, 7, 6.5], "texture": "#0"}
"uv": [ }
4, },
4, {
4.5, "name": "s4",
7 "from": [1, 0, -1],
], "to": [3, 12, 1],
"texture": "#0" "rotation": {"angle": 22.5, "axis": "x", "origin": [1, 0, 0]},
}, "faces": {
"east": { "north": {"uv": [3, 5, 3.5, 8], "texture": "#0"},
"uv": [ "east": {"uv": [3.5, 5, 4, 8], "texture": "#0"},
4.5, "south": {"uv": [5, 4, 5.5, 7], "texture": "#0"},
4, "west": {"uv": [5.5, 4, 6, 7], "texture": "#0"},
5, "up": {"uv": [6.75, 7.5, 6.25, 7], "texture": "#0"},
7 "down": {"uv": [7.5, 6.5, 7, 7], "texture": "#0"}
], }
"texture": "#0" },
}, {
"south": { "name": "s1",
"uv": [ "from": [13, 0, -1],
0, "to": [15, 12, 1],
5, "rotation": {"angle": 22.5, "axis": "x", "origin": [-1, 0, 0]},
0.5, "faces": {
8 "north": {"uv": [6, 0, 6.5, 3], "texture": "#0"},
], "east": {"uv": [6, 4, 6.5, 7], "texture": "#0"},
"texture": "#0" "south": {"uv": [6.5, 0, 7, 3], "texture": "#0"},
}, "west": {"uv": [6.5, 4, 7, 7], "texture": "#0"},
"west": { "up": {"uv": [7.25, 7.5, 6.75, 7], "texture": "#0"},
"uv": [ "down": {"uv": [7.75, 4, 7.25, 4.5], "texture": "#0"}
0.5, }
5, },
1, {
8 "name": "platform",
], "from": [0, 10, 3],
"texture": "#0" "to": [16, 12, 13],
}, "faces": {
"up": { "north": {"uv": [4, 3, 8, 3.5], "texture": "#0"},
"uv": [ "east": {"uv": [7, 0, 9.5, 0.5], "texture": "#0"},
5.75, "south": {"uv": [4, 3.5, 8, 4], "texture": "#0"},
7.5, "west": {"uv": [7, 0.5, 9.5, 1], "texture": "#0"},
5.25, "up": {"uv": [4, 2.5, 0, 0], "texture": "#0"},
7 "down": {"uv": [4, 2.5, 0, 5], "texture": "#0"}
], }
"texture": "#0" },
}, {
"down": { "name": "core",
"uv": [ "from": [6, 14, 7],
7.5, "to": [10, 16, 9],
5.5, "faces": {
7, "north": {"uv": [7, 1.5, 8, 2], "texture": "#0"},
6 "east": {"uv": [7.25, 4.5, 7.75, 5], "texture": "#0"},
], "south": {"uv": [7, 2, 8, 2.5], "texture": "#0"},
"texture": "#0" "west": {"uv": [7.25, 5, 7.75, 5.5], "texture": "#0"},
} "up": {"uv": [8, 3, 7, 2.5], "texture": "#0"},
} "down": {"uv": [5, 7, 4, 7.5], "texture": "#0"}
}, }
{ },
"name": "s3", {
"from": [ "name": "screen",
1, "from": [4, 6, -2],
-6, "to": [12, 12, -1],
14 "rotation": {"angle": 22.5, "axis": "x", "origin": [0, 0, 0]},
], "faces": {
"to": [ "north": {"uv": [4, 0, 6, 1.5], "texture": "#0"},
3, "east": {"uv": [7, 4, 7.25, 5.5], "texture": "#0"},
6, "south": {"uv": [4, 1.5, 6, 3], "texture": "#0"},
16 "west": {"uv": [5, 7, 5.25, 8.5], "texture": "#0"},
], "up": {"uv": [9, 1.25, 7, 1], "texture": "#0"},
"rotation": { "down": {"uv": [9, 1.25, 7, 1.5], "texture": "#0"}
"angle": -22.5, }
"axis": "x", }
"origin": [ ]
1,
0,
0
]
},
"faces": {
"north": {
"uv": [
1,
5,
1.5,
8
],
"texture": "#0"
},
"east": {
"uv": [
1.5,
5,
2,
8
],
"texture": "#0"
},
"south": {
"uv": [
2,
5,
2.5,
8
],
"texture": "#0"
},
"west": {
"uv": [
2.5,
5,
3,
8
],
"texture": "#0"
},
"up": {
"uv": [
6.25,
7.5,
5.75,
7
],
"texture": "#0"
},
"down": {
"uv": [
7.5,
6,
7,
6.5
],
"texture": "#0"
}
}
},
{
"name": "s4",
"from": [
1,
0,
-1
],
"to": [
3,
12,
1
],
"rotation": {
"angle": 22.5,
"axis": "x",
"origin": [
1,
0,
0
]
},
"faces": {
"north": {
"uv": [
3,
5,
3.5,
8
],
"texture": "#0"
},
"east": {
"uv": [
3.5,
5,
4,
8
],
"texture": "#0"
},
"south": {
"uv": [
5,
4,
5.5,
7
],
"texture": "#0"
},
"west": {
"uv": [
5.5,
4,
6,
7
],
"texture": "#0"
},
"up": {
"uv": [
6.75,
7.5,
6.25,
7
],
"texture": "#0"
},
"down": {
"uv": [
7.5,
6.5,
7,
7
],
"texture": "#0"
}
}
},
{
"name": "s1",
"from": [
13,
0,
-1
],
"to": [
15,
12,
1
],
"rotation": {
"angle": 22.5,
"axis": "x",
"origin": [
-1,
0,
0
]
},
"faces": {
"north": {
"uv": [
6,
0,
6.5,
3
],
"texture": "#0"
},
"east": {
"uv": [
6,
4,
6.5,
7
],
"texture": "#0"
},
"south": {
"uv": [
6.5,
0,
7,
3
],
"texture": "#0"
},
"west": {
"uv": [
6.5,
4,
7,
7
],
"texture": "#0"
},
"up": {
"uv": [
7.25,
7.5,
6.75,
7
],
"texture": "#0"
},
"down": {
"uv": [
7.75,
4,
7.25,
4.5
],
"texture": "#0"
}
}
},
{
"name": "platform",
"from": [
0,
10,
3
],
"to": [
16,
12,
13
],
"faces": {
"north": {
"uv": [
4,
3,
8,
3.5
],
"texture": "#0"
},
"east": {
"uv": [
7,
0,
9.5,
0.5
],
"texture": "#0"
},
"south": {
"uv": [
4,
3.5,
8,
4
],
"texture": "#0"
},
"west": {
"uv": [
7,
0.5,
9.5,
1
],
"texture": "#0"
},
"up": {
"uv": [
4,
2.5,
0,
0
],
"texture": "#0"
},
"down": {
"uv": [
4,
2.5,
0,
5
],
"texture": "#0"
}
}
},
{
"name": "core",
"from": [
6,
14,
7
],
"to": [
10,
16,
9
],
"faces": {
"north": {
"uv": [
7,
1.5,
8,
2
],
"texture": "#0"
},
"east": {
"uv": [
7.25,
4.5,
7.75,
5
],
"texture": "#0"
},
"south": {
"uv": [
7,
2,
8,
2.5
],
"texture": "#0"
},
"west": {
"uv": [
7.25,
5,
7.75,
5.5
],
"texture": "#0"
},
"up": {
"uv": [
8,
3,
7,
2.5
],
"texture": "#0"
},
"down": {
"uv": [
5,
7,
4,
7.5
],
"texture": "#0"
}
}
},
{
"name": "screen",
"from": [
4,
6,
-2
],
"to": [
12,
12,
-1
],
"rotation": {
"angle": 22.5,
"axis": "x",
"origin": [
0,
0,
0
]
},
"faces": {
"north": {
"uv": [
4,
0,
6,
1.5
],
"texture": "#0"
},
"east": {
"uv": [
7,
4,
7.25,
5.5
],
"texture": "#0"
},
"south": {
"uv": [
4,
1.5,
6,
3
],
"texture": "#0"
},
"west": {
"uv": [
5,
7,
5.25,
8.5
],
"texture": "#0"
},
"up": {
"uv": [
9,
1.25,
7,
1
],
"texture": "#0"
},
"down": {
"uv": [
9,
1.25,
7,
1.5
],
"texture": "#0"
}
}
}
]
} }

View File

@ -0,0 +1,49 @@
{
"parent": "minecraft:block/block",
"texture_size": [64, 64],
"textures": {
"0": "quaedam:block/reality_stabler",
"particle": "quaedam:block/reality_stabler"
},
"elements": [
{
"name": "bottom",
"from": [1, 0, 1],
"to": [15, 1, 15],
"faces": {
"north": {"uv": [7.5, 10.5, 11, 10.75], "texture": "#0"},
"east": {"uv": [7.5, 10.75, 11, 11], "texture": "#0"},
"south": {"uv": [7.5, 11, 11, 11.25], "texture": "#0"},
"west": {"uv": [11, 10.5, 14.5, 10.75], "texture": "#0"},
"up": {"uv": [11.5, 3.5, 8, 0], "texture": "#0"},
"down": {"uv": [11.5, 3.5, 8, 7], "texture": "#0"}
}
},
{
"name": "center",
"from": [0, 1, 0],
"to": [16, 14, 16],
"faces": {
"north": {"uv": [4, 0, 8, 3.25], "texture": "#0"},
"east": {"uv": [4, 3.25, 8, 6.5], "texture": "#0"},
"south": {"uv": [4, 6.5, 8, 9.75], "texture": "#0"},
"west": {"uv": [0, 8, 4, 11.25], "texture": "#0"},
"up": {"uv": [4, 4, 0, 0], "texture": "#0"},
"down": {"uv": [4, 4, 0, 8], "texture": "#0"}
}
},
{
"name": "top",
"from": [1, 14, 1],
"to": [15, 15, 15],
"faces": {
"north": {"uv": [11, 10.75, 14.5, 11], "texture": "#0"},
"east": {"uv": [11, 11, 14.5, 11.25], "texture": "#0"},
"south": {"uv": [0, 11.25, 3.5, 11.5], "texture": "#0"},
"west": {"uv": [7.5, 11.25, 11, 11.5], "texture": "#0"},
"up": {"uv": [11.5, 10.5, 8, 7], "texture": "#0"},
"down": {"uv": [7.5, 9.75, 4, 13.25], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,3 @@
{
"parent": "quaedam:block/reality_stabler"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -2,7 +2,8 @@
"replace": false, "replace": false,
"values": [ "values": [
"quaedam:projector", "quaedam:projector",
"#quaedam:projections",
"quaedam:causality_anchor", "quaedam:causality_anchor",
"#quaedam:projections" "quaedam:reality_stabler"
] ]
} }

View File

@ -2,7 +2,8 @@
"replace": false, "replace": false,
"values": [ "values": [
"quaedam:projector", "quaedam:projector",
"#quaedam:projections",
"quaedam:causality_anchor", "quaedam:causality_anchor",
"#quaedam:projections" "quaedam:reality_stabler"
] ]
} }