Skip to content

Commit 84da8d1

Browse files
committed
fix: placing
1 parent c50a87b commit 84da8d1

File tree

2 files changed

+52
-19
lines changed

2 files changed

+52
-19
lines changed

examples/test_item_model/assets/test/models/item/banner.json

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
},
88
"elements": [
99
{
10-
"from": [7.5, 0, 7.5],
11-
"to": [8.5, 21, 8.5],
12-
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
10+
"from": [7.5, 1.5, 7.5],
11+
"to": [8.5, 22.5, 8.5],
12+
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]},
1313
"faces": {
1414
"north": {"uv": [12.5, 0.5, 13, 11], "texture": "#0"},
1515
"east": {"uv": [12, 0.5, 12.5, 11], "texture": "#0"},
@@ -20,9 +20,9 @@
2020
}
2121
},
2222
{
23-
"from": [3, 21, 7.5],
24-
"to": [13, 22, 8.5],
25-
"rotation": {"angle": 0, "axis": "y", "origin": [8, 22, 8]},
23+
"from": [3, 22.5, 7.5],
24+
"to": [13, 23.5, 8.5],
25+
"rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 8]},
2626
"faces": {
2727
"north": {"uv": [6, 11, 11, 11.5], "texture": "#0"},
2828
"east": {"uv": [5.5, 11, 6, 11.5], "texture": "#0"},
@@ -33,9 +33,9 @@
3333
}
3434
},
3535
{
36-
"from": [3, 2, 8.5],
37-
"to": [13, 22, 9.5],
38-
"rotation": {"angle": 0, "axis": "y", "origin": [9, 2, 9]},
36+
"from": [3, 3.5, 8.5],
37+
"to": [13, 23.5, 9.5],
38+
"rotation": {"angle": 0, "axis": "y", "origin": [9, 4, 9]},
3939
"faces": {
4040
"north": {"uv": [5.5, 0.25, 10.5, 10.25], "texture": "#0"},
4141
"east": {"uv": [5.25, 0.25, 5.5, 10.25], "texture": "#0"},
@@ -45,5 +45,35 @@
4545
"down": {"uv": [5.25, 0, 10.25, 0.25], "texture": "#0"}
4646
}
4747
}
48-
]
48+
],
49+
"gui_light": "front",
50+
"display": {
51+
"thirdperson_righthand": {
52+
"rotation": [0, 90, 0],
53+
"translation": [0, 2, 0.5],
54+
"scale": [0.375, 0.375, 0.375]
55+
},
56+
"firstperson_righthand": {
57+
"rotation": [0, 90, 0],
58+
"scale": [0.375, 0.375, 0.375]
59+
},
60+
"ground": {
61+
"translation": [0, 1, 0],
62+
"scale": [0.25, 0.25, 0.25]
63+
},
64+
"gui": {
65+
"rotation": [30, 20, 0],
66+
"translation": [0, -3.25, 0],
67+
"scale": [0.75, 0.75, 0.75]
68+
},
69+
"head": {
70+
"rotation": [0, -180, 0],
71+
"translation": [0, 16, 7],
72+
"scale": [1.5, 1.5, 1.5]
73+
},
74+
"fixed": {
75+
"rotation": [0, -180, 0],
76+
"scale": [0.5, 0.5, 0.5]
77+
}
78+
}
4979
}

model_resolver/item_model/special.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ class SpecialModelBanner(SpecialModelBaseLayer):
124124
def get_base_color(self, item: Item) -> str | None:
125125
return self.color
126126

127+
def get_scale(self) -> float:
128+
return 0.75/0.5325
129+
127130
def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
128131
texture = self.get_texture(getter, item)
129132
res = {
@@ -132,9 +135,9 @@ def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
132135
},
133136
"elements": [
134137
{
135-
"from": [7.5, 0, 7.5],
136-
"to": [8.5, 21, 8.5],
137-
"rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]},
138+
"from": [7.5, 1.5, 7.5],
139+
"to": [8.5, 22.5, 8.5],
140+
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 8]},
138141
"faces": {
139142
"north": {"uv": [12.5, 0.5, 13, 11], "texture": "#0"},
140143
"east": {"uv": [12, 0.5, 12.5, 11], "texture": "#0"},
@@ -145,9 +148,9 @@ def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
145148
}
146149
},
147150
{
148-
"from": [3, 21, 7.5],
149-
"to": [13, 22, 8.5],
150-
"rotation": {"angle": 0, "axis": "y", "origin": [8, 22, 8]},
151+
"from": [3, 22.5, 7.5],
152+
"to": [13, 23.5, 8.5],
153+
"rotation": {"angle": 0, "axis": "y", "origin": [8, 24, 8]},
151154
"faces": {
152155
"north": {"uv": [6, 11, 11, 11.5], "texture": "#0"},
153156
"east": {"uv": [5.5, 11, 6, 11.5], "texture": "#0"},
@@ -158,9 +161,9 @@ def get_model(self, getter: PackGetterV2, item: Item) -> dict[str, Any]:
158161
}
159162
},
160163
{
161-
"from": [3, 2, 8.5],
162-
"to": [13, 22, 9.5],
163-
"rotation": {"angle": 0, "axis": "y", "origin": [9, 2, 9]},
164+
"from": [3, 3.5, 8.5],
165+
"to": [13, 23.5, 9.5],
166+
"rotation": {"angle": 0, "axis": "y", "origin": [9, 4, 9]},
164167
"faces": {
165168
"north": {"uv": [5.5, 0.25, 10.5, 10.25], "texture": "#0"},
166169
"east": {"uv": [5.25, 0.25, 5.5, 10.25], "texture": "#0"},

0 commit comments

Comments
 (0)