Skip to content

Commit cc88b83

Browse files
committed
🛠️ Fix transparent texture and missing tags
- Fix incorrect export location for transparent texture. - Fix tags getting cleared out in old exports.
1 parent 271a0f6 commit cc88b83

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"generic-stream": "^1.2.6",
116116
"marked": "^4.3.0",
117117
"marked-gfm-heading-id": "^3.0.0",
118-
"mc-build": "^3.4.3",
118+
"mc-build": "^3.5.1",
119119
"request-progress": "^3.0.0",
120120
"svelte-ace": "^1.0.21",
121121
"svelte-dnd-action": "^0.9.38"

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ dir <%export_namespace%> {
510510
#Args: {args:{variant: string, animation: string, frame: int, start_animation: boolean}}
511511
# frame is ignored unless animation is specified.
512512

513-
data modify storage aj:temp args set value {variant:'', animation:'', frame: 0}
513+
data modify storage aj:temp args set value {frame: 0}
514514
$execute store success score #success <%OBJECTIVES.I()%> run data modify storage aj:temp args set value $(args)
515515

516516
summon minecraft:item_display ~ ~ ~ { \

src/systems/datapackCompiler/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,16 @@ async function writeFiles(map: Map<string, string>, dataPackFolder: string) {
829829
const value = typeof v === 'string' ? v : v.id
830830
const isTag = value.startsWith('#')
831831
const location = parseResourceLocation(isTag ? value.substring(1) : value)
832+
// If the target version is 1.21.0 or higher, use the 'function' namespace instead of 'functions'
833+
const functionNamespace = compareVersions(aj.target_minecraft_version, '1.21.0')
834+
? 'function'
835+
: 'functions'
836+
console.log('Checking:', value, location, functionNamespace)
832837
const vPath = PathModule.join(
833838
dataPackFolder,
834839
'data',
835840
location.namespace,
836-
isTag ? 'tags/function' : 'function',
841+
isTag ? 'tags/' + functionNamespace : functionNamespace,
837842
location.path + (isTag ? '.json' : '.mcfunction')
838843
)
839844
const exists = map.has(vPath) || fs.existsSync(vPath)

src/systems/resourcepackCompiler/1.21.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export default async function compileResourcePack(options: {
271271
// Transparent texture
272272
const transparentTexturePath = PathModule.join(
273273
resourcePackFolder,
274-
'assets/animated_java/textures/item/transparent.png'
274+
'assets/animated_java/textures/blueprint/transparent.png'
275275
)
276276
exportedFiles.set(
277277
transparentTexturePath,

src/systems/resourcepackCompiler/1.21.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default async function compileResourcePack(options: {
134134
// Transparent texture
135135
const transparentTexturePath = PathModule.join(
136136
resourcePackFolder,
137-
'assets/animated_java/textures/item/transparent.png'
137+
'assets/animated_java/textures/blueprint/transparent.png'
138138
)
139139
exportedFiles.set(
140140
transparentTexturePath,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,10 +3064,10 @@ matcher@^3.0.0:
30643064
dependencies:
30653065
escape-string-regexp "^4.0.0"
30663066

3067-
mc-build@^3.4.3:
3068-
version "3.4.3"
3069-
resolved "https://registry.yarnpkg.com/mc-build/-/mc-build-3.4.3.tgz#3532835231fcc36974463bab6785728890c4e6f1"
3070-
integrity sha512-DqfRaDscaNZCmKGCun8/rfG62dD8UvScwh6cxk6hyssImmFiAkwfGJD++7ezXu9iy4cCKSZuwuECpswz8qI79Q==
3067+
mc-build@^3.5.1:
3068+
version "3.5.1"
3069+
resolved "https://registry.yarnpkg.com/mc-build/-/mc-build-3.5.1.tgz#684bf069701d62b85c8d698be6679bb92f5d4044"
3070+
integrity sha512-bySCg9VA+V0++SqfJrBcPxU9t8UrifcecGpXAR/21kqV4uWItoo12MqBSN3bI6f51j3vbVIrdOAH+PiWBp5S7w==
30713071

30723072
md5@^2.3.0:
30733073
version "2.3.0"

0 commit comments

Comments
 (0)