mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-02-17 16:20:13 +08:00
Fix issue in modded entity syntax for 1.17+
This commit is contained in:
parent
207d514197
commit
e5467b7e96
@ -271,7 +271,8 @@ const Templates = {
|
||||
}
|
||||
}`,
|
||||
field: `private final ModelPart %(bone);`,
|
||||
model_part: `this.%(bone) = root.getChild("%(bone)");`,
|
||||
model_part: `?(has_no_parent)this.%(bone) = root.getChild("%(bone)");
|
||||
?(has_parent)this.%(bone) = this.%(parent).getChild("%(bone)");`,
|
||||
bone:
|
||||
`?(has_no_parent)PartDefinition %(bone) = partdefinition.addOrReplaceChild("%(bone)", CubeListBuilder.create()
|
||||
?(has_parent)PartDefinition %(bone) = %(parent).addOrReplaceChild("%(bone)", CubeListBuilder.create()
|
||||
@ -312,7 +313,8 @@ const Templates = {
|
||||
}
|
||||
}`,
|
||||
field: `private final ModelPart %(bone);`,
|
||||
model_part: `this.%(bone) = root.getChild("%(bone)");`,
|
||||
model_part: `?(has_no_parent)this.%(bone) = root.getChild("%(bone)");
|
||||
?(has_parent)this.%(bone) = this.%(parent).getChild("%(bone)");`,
|
||||
bone:
|
||||
`?(has_no_parent)ModelPartData %(bone) = modelPartData.addChild("%(bone)", ModelPartBuilder.create()
|
||||
?(has_parent)ModelPartData %(bone) = %(parent).addChild("%(bone)", ModelPartBuilder.create()
|
||||
@ -609,7 +611,12 @@ var codec = new Codec('modded_entity', {
|
||||
if (group.is_rotation_subgroup) continue;
|
||||
//if (usesLayerDef && group.parent instanceof Group) continue;
|
||||
let modelPart = snippet
|
||||
.replace(R('bone'), group.name);
|
||||
.replace(R('bone'), group.name)
|
||||
.replace(/\t+/, '')
|
||||
.replace(/(?:\n|^)\?\(has_parent\).+/, group.parent instanceof Group ? Templates.keepLine : '')
|
||||
.replace(/(?:\n|^)\?\(has_no_parent\).+/, group.parent instanceof Group ? '' : Templates.keepLine)
|
||||
.trim()
|
||||
.replace(R('parent'), group.parent.name)
|
||||
group_snippets.push(modelPart);
|
||||
}
|
||||
return group_snippets.join('\n\t\t')
|
||||
|
Loading…
Reference in New Issue
Block a user