Skip to content

Commit 0038337

Browse files
committed
feat: hanging signs #12
1 parent f78bbfe commit 0038337

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed
1.18 KB
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"model": {
3+
"type": "minecraft:special",
4+
"base": "minecraft:block/oak_sign",
5+
"model": {
6+
"type": "hanging_sign",
7+
"wood_type": "acacia"
8+
}
9+
}
10+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"format_version": "1.21.6",
3+
"credit": "Made with Blockbench",
4+
"textures": {
5+
"0": "entity/signs/hanging/acacia",
6+
"particle": "entity/signs/hanging/acacia"
7+
},
8+
"elements": [
9+
{
10+
"from": [1, 0, 7],
11+
"to": [15, 10, 9],
12+
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 7]},
13+
"faces": {
14+
"north": {"uv": [4.5, 7, 8, 12], "texture": "#0"},
15+
"east": {"uv": [4, 7.25, 4.5, 12], "texture": "#0"},
16+
"south": {"uv": [0.5, 7, 4, 12], "texture": "#0"},
17+
"west": {"uv": [0, 7, 0.5, 12], "texture": "#0"},
18+
"up": {"uv": [0.5, 6, 4, 7], "texture": "#0"},
19+
"down": {"uv": [4, 7, 7.5, 6], "texture": "#0"}
20+
}
21+
},
22+
{
23+
"from": [2, 10, 8],
24+
"to": [14, 16, 8],
25+
"rotation": {"angle": 0, "axis": "y", "origin": [2, 10, 8]},
26+
"faces": {
27+
"north": {"uv": [6.5, 3, 3.5, 6], "texture": "#0"},
28+
"south": {"uv": [3.5, 3, 6.5, 6], "texture": "#0"}
29+
}
30+
}
31+
],
32+
"display": {}
33+
}

examples/test_item_model/my_pipeline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ def beet_default(ctx: Context):
125125
}), path_ctx="test:render/pot", render_size=512)
126126

127127

128+
render.add_item_task(Item(id="minecraft:diamond", components={
129+
"minecraft:item_model": "test:hanging_sign",
130+
}), path_ctx="test:render/hanging_sing", render_size=512)
131+
132+
128133

129134
render.add_model_task("test:item/conduit", path_ctx="test:render/conduit", render_size=512)
130135
render.add_item_task(Item(id="stone", components={

model_resolver/item_model/special.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,38 @@ def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
12051205
class SpecialModelHangingSign(SpecialModelSignBase):
12061206
type: Literal["minecraft:hanging_sign", "hanging_sign"]
12071207

1208+
def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
1209+
res = {
1210+
"textures": {
1211+
"0": self.used_texture,
1212+
},
1213+
"elements": [
1214+
{
1215+
"from": [1, 0, 7],
1216+
"to": [15, 10, 9],
1217+
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 7]},
1218+
"faces": {
1219+
"north": {"uv": [4.5, 7, 8, 12], "texture": "#0"},
1220+
"east": {"uv": [4, 7.25, 4.5, 12], "texture": "#0"},
1221+
"south": {"uv": [0.5, 7, 4, 12], "texture": "#0"},
1222+
"west": {"uv": [0, 7, 0.5, 12], "texture": "#0"},
1223+
"up": {"uv": [0.5, 6, 4, 7], "texture": "#0"},
1224+
"down": {"uv": [4, 7, 7.5, 6], "texture": "#0"}
1225+
}
1226+
},
1227+
{
1228+
"from": [2, 10, 8],
1229+
"to": [14, 16, 8],
1230+
"rotation": {"angle": 0, "axis": "y", "origin": [2, 10, 8]},
1231+
"faces": {
1232+
"north": {"uv": [6.5, 3, 3.5, 6], "texture": "#0"},
1233+
"south": {"uv": [3.5, 3, 6.5, 6], "texture": "#0"}
1234+
}
1235+
}
1236+
]
1237+
}
1238+
return res
1239+
12081240

12091241
type SpecialModel = Union[
12101242
SpecialModelBed,

0 commit comments

Comments
 (0)