Skip to content

Commit

Permalink
🛠️ Fix transparent texture and missing tags
Browse files Browse the repository at this point in the history
- Fix incorrect export location for transparent texture.
- Fix tags getting cleared out in old exports.
  • Loading branch information
SnaveSutit committed Jan 8, 2025
1 parent 271a0f6 commit cc88b83
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"generic-stream": "^1.2.6",
"marked": "^4.3.0",
"marked-gfm-heading-id": "^3.0.0",
"mc-build": "^3.4.3",
"mc-build": "^3.5.1",
"request-progress": "^3.0.0",
"svelte-ace": "^1.0.21",
"svelte-dnd-action": "^0.9.38"
Expand Down
2 changes: 1 addition & 1 deletion src/systems/datapackCompiler/1.20.4/animation.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ dir <%export_namespace%> {
#Args: {args:{variant: string, animation: string, frame: int, start_animation: boolean}}
# frame is ignored unless animation is specified.

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

summon minecraft:item_display ~ ~ ~ { \
Expand Down
7 changes: 6 additions & 1 deletion src/systems/datapackCompiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,11 +829,16 @@ async function writeFiles(map: Map<string, string>, dataPackFolder: string) {
const value = typeof v === 'string' ? v : v.id
const isTag = value.startsWith('#')
const location = parseResourceLocation(isTag ? value.substring(1) : value)
// If the target version is 1.21.0 or higher, use the 'function' namespace instead of 'functions'
const functionNamespace = compareVersions(aj.target_minecraft_version, '1.21.0')
? 'function'
: 'functions'
console.log('Checking:', value, location, functionNamespace)
const vPath = PathModule.join(
dataPackFolder,
'data',
location.namespace,
isTag ? 'tags/function' : 'function',
isTag ? 'tags/' + functionNamespace : functionNamespace,
location.path + (isTag ? '.json' : '.mcfunction')
)
const exists = map.has(vPath) || fs.existsSync(vPath)
Expand Down
2 changes: 1 addition & 1 deletion src/systems/resourcepackCompiler/1.21.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default async function compileResourcePack(options: {
// Transparent texture
const transparentTexturePath = PathModule.join(
resourcePackFolder,
'assets/animated_java/textures/item/transparent.png'
'assets/animated_java/textures/blueprint/transparent.png'
)
exportedFiles.set(
transparentTexturePath,
Expand Down
2 changes: 1 addition & 1 deletion src/systems/resourcepackCompiler/1.21.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default async function compileResourcePack(options: {
// Transparent texture
const transparentTexturePath = PathModule.join(
resourcePackFolder,
'assets/animated_java/textures/item/transparent.png'
'assets/animated_java/textures/blueprint/transparent.png'
)
exportedFiles.set(
transparentTexturePath,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3064,10 +3064,10 @@ matcher@^3.0.0:
dependencies:
escape-string-regexp "^4.0.0"

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

md5@^2.3.0:
version "2.3.0"
Expand Down

0 comments on commit cc88b83

Please sign in to comment.