hytopia 0.9.3 → 0.9.5-prerelease

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 CHANGED
@@ -175,7 +175,7 @@ function installProjectDependencies() {
175
175
  description: 'My HYTOPIA project',
176
176
  main: 'index.ts',
177
177
  scripts: {
178
- dev: 'hytopia dev'
178
+ start: 'hytopia start'
179
179
  }
180
180
  }, null, 2));
181
181
 
@@ -235,7 +235,7 @@ function displayInitSuccessMessage() {
235
235
  logDivider();
236
236
  console.log('✅ HYTOPIA PROJECT INITIALIZED SUCCESSFULLY!');
237
237
  console.log(' ');
238
- console.log('💡 1. Start your development server by running the command `hytopia dev`');
238
+ console.log('💡 1. Start your development server by running the command `hytopia start`');
239
239
  console.log('🎮 2. Play your game by opening: https://hytopia.com/play/?join=localhost:8080');
240
240
  logDivider();
241
241
  }
@@ -524,8 +524,30 @@ function copyDirectoryContents(srcDir, destDir, options = { recursive: true }) {
524
524
  if (!fs.existsSync(srcDir)) return false;
525
525
 
526
526
  try {
527
+ if (!fs.existsSync(destDir)) {
528
+ fs.mkdirSync(destDir, { recursive: true });
529
+ }
530
+
527
531
  fs.readdirSync(srcDir).forEach(item => {
528
- fs.cpSync(path.join(srcDir, item), path.join(destDir, item), options);
532
+ const srcPath = path.join(srcDir, item);
533
+ const destPath = path.join(destDir, item);
534
+ const stat = fs.statSync(srcPath);
535
+
536
+ if (stat.isDirectory()) {
537
+ // If destination dir exists, merge contents; else copy whole dir
538
+ if (fs.existsSync(destPath) && fs.statSync(destPath).isDirectory()) {
539
+ fs.mkdirSync(destPath, { recursive: true });
540
+ fs.readdirSync(srcPath).forEach(child => {
541
+ const childSrc = path.join(srcPath, child);
542
+ const childDest = path.join(destPath, child);
543
+ fs.cpSync(childSrc, childDest, { recursive: true, force: false });
544
+ });
545
+ } else {
546
+ fs.cpSync(srcPath, destPath, { recursive: true, force: false });
547
+ }
548
+ } else {
549
+ fs.cpSync(srcPath, destPath, options);
550
+ }
529
551
  });
530
552
  return true;
531
553
  } catch {
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## BlockTypeOptions.lightLevel property
6
6
 
7
- The light emission level.
7
+ The light emission level, between 0 and 15.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -126,7 +126,7 @@ number
126
126
 
127
127
  </td><td>
128
128
 
129
- _(Optional)_ The light emission level.
129
+ _(Optional)_ The light emission level, between 0 and 15.
130
130
 
131
131
 
132
132
  </td></tr>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.9.3",
3
+ "version": "0.9.5-prerelease",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./server.js",
package/server.api.json CHANGED
@@ -5543,7 +5543,7 @@
5543
5543
  {
5544
5544
  "kind": "PropertySignature",
5545
5545
  "canonicalReference": "server!BlockTypeOptions#lightLevel:member",
5546
- "docComment": "/**\n * The light emission level.\n */\n",
5546
+ "docComment": "/**\n * The light emission level, between 0 and 15.\n */\n",
5547
5547
  "excerptTokens": [
5548
5548
  {
5549
5549
  "kind": "Content",
package/server.d.ts CHANGED
@@ -662,7 +662,7 @@ export declare interface BlockTypeOptions {
662
662
  halfExtents?: Vector3Like;
663
663
  /** Whether the block type is a liquid. */
664
664
  isLiquid?: boolean;
665
- /** The light emission level. */
665
+ /** The light emission level, between 0 and 15. */
666
666
  lightLevel?: number;
667
667
  /** The name of the block type. */
668
668
  name: string;