Skip to content

Commit b968422

Browse files
committed
🐛 Fix crash when exporting
1 parent b28a461 commit b968422

File tree

8 files changed

+18
-38
lines changed

8 files changed

+18
-38
lines changed

src/mods/eventHooks.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,16 @@ registerPropertyOverrideMod({
4646
}
4747
},
4848
})
49+
50+
registerPropertyOverrideMod({
51+
id: `animated-java:event-hook/pre-select-project-event`,
52+
object: ModelProject.prototype,
53+
key: 'select',
54+
55+
get: original => {
56+
return function (this: ModelProject) {
57+
EVENTS.PRE_SELECT_PROJECT.publish(this)
58+
return original.call(this)
59+
}
60+
},
61+
})

src/mods/modelFormatSelectMod.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/systems/datapackCompiler/1.20.4/global.mcb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ dir global {
117117

118118
# Removes locators and cameras owned by the rig, even if they're not included in the currently loaded export.
119119
function outdated_rig {
120-
# Assert that the function is being executed as a root entity.
121-
debug assert executed_as_root_entity <%TAGS.GLOBAL_ROOT()%>
122-
123120
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
124121
data remove storage <%temp_storage%> args
125122
data remove storage <%temp_storage%> uuids
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
template debug {
2-
with assert:literal executed_as_root_entity:literal root_tag:literal {
2+
with assert:literal executed_as_root_entity:literal root_tag:js {
33
IF (debug_mode) {
44
execute unless entity @s[type=minecraft:item_display,tag=<%root_tag%>] run return run \
5-
tellraw @a <%TELLRAW.FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR(context.functions.at(-1))%>
5+
tellraw @a <%TELLRAW.FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR(context.functions.at(-1), root_tag)%>
66
}
77
}
88
}

src/systems/datapackCompiler/1.21.2/global.mcb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ dir global {
117117

118118
# Removes locators and cameras owned by the rig, even if they're not included in the currently loaded export.
119119
function outdated_rig {
120-
# Assert that the function is being executed as a root entity.
121-
debug assert executed_as_root_entity <%TAGS.GLOBAL_ROOT()%>
122-
123120
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
124121
data remove storage <%temp_storage%> args
125122
data remove storage <%temp_storage%> uuids

src/systems/datapackCompiler/1.21.5/global.mcb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ dir global {
117117

118118
# Removes locators and cameras owned by the rig, even if they're not included in the currently loaded export.
119119
function outdated_rig {
120-
# Assert that the function is being executed as a root entity.
121-
debug assert executed_as_root_entity <%TAGS.GLOBAL_ROOT()%>
122-
123120
execute on passengers if entity @s[tag=<%TAGS.GLOBAL_DATA()%>] run block as_data {
124121
data remove storage <%temp_storage%> args
125122
data remove storage <%temp_storage%> uuids

src/systems/datapackCompiler/tellraw.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { toSmallCaps } from 'src/util/minecraftUtil'
22
import { type IRenderedAnimation } from '../animationRenderer'
33
import { JsonText, TextElement } from '../jsonText'
44
import { type IRenderedVariant } from '../rigRenderer'
5-
import { TAGS } from './tags'
65

76
const TELLRAW_PREFIX = () =>
87
new JsonText([
@@ -120,12 +119,10 @@ namespace TELLRAW {
120119
.toString()
121120
.replaceAll('\\n', '\\\\n')
122121

123-
export const FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR = (functionPath: string) => {
122+
export const FUNCTION_NOT_EXECUTED_AS_ROOT_ERROR = (functionPath: string, tag: string) => {
124123
const hoverText = new JsonText([{ text: functionPath, color: 'yellow' }, '']).flatten()
125124

126-
const exampleCommand = `/execute as @e[tag=${TAGS.PROJECT_ROOT(
127-
Project!.animated_java.export_namespace
128-
)}] run function ${functionPath}`
125+
const exampleCommand = `/execute as @e[tag=${tag}] run function ${functionPath}`
129126

130127
return TELLRAW_ERROR('Function Not Executed as Root Entity', [
131128
!compareVersions('1.21.5', Project!.animated_java.target_minecraft_version)

test-packs/latest/blueprints/armor_stand_latest.ajblueprint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"meta": {
33
"format": "animated-java:format/blueprint",
4-
"format_version": "1.8.0-beta.3",
4+
"format_version": "1.8.0-beta.4",
55
"uuid": "167b27cd-b559-3f13-a97c-0841fe21f1d1",
66
"save_location": "D:\\github-repos\\animated-java\\old-animated-java\\test-packs\\latest\\blueprints\\armor_stand_latest.ajblueprint",
77
"last_used_export_namespace": "armor_stand"

0 commit comments

Comments
 (0)