hytopia 0.3.31 → 0.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/scripts.js +42 -0
- package/examples/hygrounds/gameConfig.ts +2 -2
- package/package.json +1 -1
- package/server.js +1 -1
- package/examples/child-entity/assets/models/.optimized/baseColor.png +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/baseColor.png +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/sword.bin +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/sword.gltf +0 -356
- package/examples/child-entity/assets/models/.optimized/sword.bin +0 -0
- package/examples/child-entity/assets/models/.optimized/sword.gltf +0 -136
package/bin/scripts.js
CHANGED
@@ -268,6 +268,48 @@ function packageProject() {
|
|
268
268
|
console.error('❌ Error: Could not read package.json file:', err.message);
|
269
269
|
return;
|
270
270
|
}
|
271
|
+
|
272
|
+
// Make sure assets exist and the model optimizer has been ran
|
273
|
+
const assetsDir = path.join(sourceDir, 'assets');
|
274
|
+
let hasOptimizedDir = false;
|
275
|
+
|
276
|
+
if (fs.existsSync(assetsDir)) {
|
277
|
+
// Function to recursively check for .optimized directories
|
278
|
+
const checkForOptimizedDir = (dir) => {
|
279
|
+
const items = fs.readdirSync(dir);
|
280
|
+
|
281
|
+
for (const item of items) {
|
282
|
+
const itemPath = path.join(dir, item);
|
283
|
+
const stats = fs.statSync(itemPath);
|
284
|
+
|
285
|
+
if (stats.isDirectory()) {
|
286
|
+
if (item === '.optimized') {
|
287
|
+
hasOptimizedDir = true;
|
288
|
+
return true;
|
289
|
+
}
|
290
|
+
|
291
|
+
// Check subdirectories
|
292
|
+
if (checkForOptimizedDir(itemPath)) {
|
293
|
+
return true;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
return false;
|
299
|
+
};
|
300
|
+
|
301
|
+
checkForOptimizedDir(assetsDir);
|
302
|
+
|
303
|
+
if (!hasOptimizedDir) {
|
304
|
+
console.warn('❌ Error: No .optimized directories found in the assets folder.');
|
305
|
+
console.warn(' Make sure your server has ran the optimizer for your models.');
|
306
|
+
console.warn(' This can be done by running your server with: bun --watch index.ts');
|
307
|
+
return;
|
308
|
+
}
|
309
|
+
} else {
|
310
|
+
console.warn('❌ Error: No assets directory found in the project.');
|
311
|
+
return;
|
312
|
+
}
|
271
313
|
|
272
314
|
// Prepare to package
|
273
315
|
const outputFile = path.join(sourceDir, `${projectName}.zip`);
|
@@ -100,7 +100,7 @@ export const CHEST_DROP_ITEMS = [
|
|
100
100
|
},
|
101
101
|
{
|
102
102
|
itemId: 'rocket-launcher',
|
103
|
-
pickWeight: 0.
|
103
|
+
pickWeight: 0.5,
|
104
104
|
},
|
105
105
|
{
|
106
106
|
itemId: 'shotgun',
|
@@ -404,7 +404,7 @@ export const ITEM_SPAWN_ITEMS = [
|
|
404
404
|
},
|
405
405
|
{
|
406
406
|
itemId: 'rocket-launcher',
|
407
|
-
pickWeight: 0.
|
407
|
+
pickWeight: 0.5,
|
408
408
|
},
|
409
409
|
{
|
410
410
|
itemId: 'shotgun',
|