Skip to content

Commit 43777da

Browse files
committed
Fix 1.20 rotation issues
1 parent a7ecfb0 commit 43777da

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

exporters/datapackExporter/exporter/datapackGen/namespaceFolderGen.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export function generateNamespaceFolder() {
120120
'interpolation_duration',
121121
new NbtInt(exporterSettings.interpolation_duration.value)
122122
)
123+
.set('item_display', new NbtString('head'))
123124
if (bone.type === 'bone') {
124125
passenger.set(
125126
'item',
@@ -199,7 +200,10 @@ export function generateNamespaceFolder() {
199200
`execute as @e[type=${G.ENTITY_TYPES.ajRoot},tag=${G.TAGS.rootEntity}] run function ${G.AJ_NAMESPACE}:remove/as_root`,
200201
])
201202
// ANCHOR - function NAMESPACE:remove/all
202-
.chainNewFile('all.mcfunction', [`kill @e[tag=${G.TAGS.rigEntity}]`])
203+
.chainNewFile('all.mcfunction', [
204+
`execute as @e[type=${G.ENTITY_TYPES.ajRoot},tag=${G.TAGS.rootEntity}] run function ${G.AJ_NAMESPACE}:remove/as_root`,
205+
`kill @e[tag=${G.TAGS.rigEntity}]`,
206+
])
203207

204208
for (const variant of G.VARIANTS) {
205209
// ANCHOR - func NAMESPACE:apply_variant/${variant.name}

src/rendering/animationRenderer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ export function restoreSceneAngle() {
1616
function getNodeMatrix(node: OutlinerElement, scale: number) {
1717
const matrixWorld = node.mesh.matrixWorld.clone()
1818
matrixWorld.setPosition(
19-
new THREE.Vector3()
20-
.setFromMatrixPosition(matrixWorld)
21-
.multiplyScalar(1 / 16)
22-
.multiply(new THREE.Vector3(-1, 1, -1))
19+
new THREE.Vector3().setFromMatrixPosition(matrixWorld).multiplyScalar(1 / 16)
20+
// .multiply(new THREE.Vector3(-1, 1, -1))
2321
)
2422
matrixWorld.scale(new THREE.Vector3().setScalar(scale))
2523
return matrixWorld

src/rendering/modelRenderer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export interface IRenderedModel {
3939
parent?: string
4040
textures: Record<string, string>
4141
elements?: IRenderedElement[]
42+
display?: {
43+
head: { rotation: [0, 180, 0] }
44+
}
4245
}
4346

4447
export interface IRenderedNode {
@@ -300,6 +303,9 @@ function renderGroup(group: Group, rig: IRenderedRig) {
300303
model: {
301304
textures: {},
302305
elements: [],
306+
display: {
307+
head: { rotation: [0, 180, 0] },
308+
},
303309
},
304310
modelPath: path,
305311
customModelData: -1,

0 commit comments

Comments
 (0)