Skip to content
This repository was archived by the owner on Jul 17, 2022. It is now read-only.

Commit 0292a7f

Browse files
Merge pull request #8 from outercloudstudio/dev
Compiler Stability + Bug fixes
2 parents 5f9bc3b + f288883 commit 0292a7f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Firework.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ export async function Start(path, com){
9191
}, null, 2))
9292
}
9393

94+
if(!JSON.parse(fs.readFileSync(com + '/development_behavior_packs/' + projectName + ' BP/functions/tick.json')).values.includes('firework_runtime')){
95+
fs.writeFileSync(com + '/development_behavior_packs/' + projectName + ' BP/functions/tick.json', JSON.stringify({
96+
values: [
97+
'firework_runtime',
98+
...JSON.parse(fs.readFileSync(com + '/development_behavior_packs/' + projectName + ' BP/functions/tick.json')).values
99+
]
100+
}, null, 2))
101+
}
102+
94103
fs.copyFileSync('./data/firework_runtime.mcfunction', com + '/development_behavior_packs/' + projectName + ' BP/functions/firework_runtime.mcfunction')
95104

96105
if(!fs.existsSync(com + '/development_behavior_packs/' + projectName + ' BP/animations/')){
@@ -154,7 +163,7 @@ export async function Start(path, com){
154163

155164
let waits = 0
156165

157-
while(!sourceJson && waits < 100){
166+
while((!sourceJson || sourceJson.__error__) && waits < 50){
158167
try{
159168
sourceJson = JSON.parse(fs.readFileSync(sourceFilePath))
160169
}catch{}
@@ -164,8 +173,8 @@ export async function Start(path, com){
164173
await sleep(100)
165174
}
166175

167-
if(waits >= 100){
168-
spinner3.fail()
176+
if(waits >= 50){
177+
spinner3.error()
169178

170179
console.log(chalk.hex('#ffc825').bold('Warning:') + ' Failed to load ' + files[i])
171180

0 commit comments

Comments
 (0)