Skip to content

Commit

Permalink
Upload generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
jayly-bot authored and github-actions[bot] committed May 17, 2024
1 parent 9bdb49c commit ba6ded0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions scripts/database/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Script example for ScriptAPI
// Author: iBlqzed <https://github.com/iBlqzed>
// Project: https://github.com/JaylyDev/ScriptAPI

import { world, system } from "@minecraft/server";
export class Database {
constructor(name, defaultValue = "{}") {
Expand Down Expand Up @@ -72,7 +71,7 @@ export class Database {
* @returns {Record<string, V>} An object of all keys and values
*/
getAll() {
return this.cache ?? (this.cache = Database.getAll(this.name, this.defaultValue));
return this.cache ??= Database.getAll(this.name, this.defaultValue);
}
/**
* Save the database instantly
Expand Down
24 changes: 12 additions & 12 deletions scripts/vector3-polyfill/Vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Vector {
const DirectionX = this.x / magnitude;
const DirectionY = this.y / magnitude;
const DirectionZ = this.z / magnitude;
return new Vector(DirectionX, DirectionY, DirectionZ);
return new _a(DirectionX, DirectionY, DirectionZ);
}
/**
* @remarks
Expand All @@ -69,7 +69,7 @@ export class Vector {
* @returns {Vector}
*/
static add(a, b) {
const vector = new Vector(a.x, a.y, a.z);
const vector = new _a(a.x, a.y, a.z);
vector.x += b.x;
vector.y += b.y;
vector.z += b.z;
Expand All @@ -83,7 +83,7 @@ export class Vector {
* @returns {Vector}
*/
static cross(a, b) {
return new Vector(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
return new _a(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
}
/**
* @remarks
Expand All @@ -107,7 +107,7 @@ export class Vector {
* @returns {Vector}
*/
static divide(a, b) {
const vector = new Vector(a.x, a.y, a.z);
const vector = new _a(a.x, a.y, a.z);
if (typeof b === "number") {
vector.x /= b;
vector.y /= b;
Expand All @@ -130,7 +130,7 @@ export class Vector {
* @returns {Vector}
*/
static lerp(a, b, t) {
const dest = new Vector(a.x, a.y, a.z);
const dest = new _a(a.x, a.y, a.z);
dest.x += (b.x - a.x) * t;
dest.y += (b.y - a.y) * t;
dest.z += (b.z - a.z) * t;
Expand All @@ -146,11 +146,11 @@ export class Vector {
*/
static max(a, b) {
const vectors = [a, b];
const arr = vectors.map(({ x, y, z }) => new Vector(x, y, z).length());
const arr = vectors.map(({ x, y, z }) => new _a(x, y, z).length());
const max = Math.max(...arr);
const index = arr.indexOf(max);
const vector3 = vectors[index];
return new Vector(vector3.x, vector3.y, vector3.z);
return new _a(vector3.x, vector3.y, vector3.z);
}
/**
* @remarks
Expand All @@ -162,11 +162,11 @@ export class Vector {
*/
static min(a, b) {
const vectors = [a, b];
const arr = vectors.map(({ x, y, z }) => new Vector(x, y, z).length());
const arr = vectors.map(({ x, y, z }) => new _a(x, y, z).length());
const min = Math.min(...arr);
const index = arr.indexOf(min);
const vector3 = vectors[index];
return new Vector(vector3.x, vector3.y, vector3.z);
return new _a(vector3.x, vector3.y, vector3.z);
}
/**
* @remarks
Expand All @@ -176,7 +176,7 @@ export class Vector {
* @returns {Vector}
*/
static multiply(a, b) {
const vector = new Vector(a.x, a.y, a.z);
const vector = new _a(a.x, a.y, a.z);
if (typeof b === "number") {
vector.x *= b;
vector.y *= b;
Expand Down Expand Up @@ -210,7 +210,7 @@ export class Vector {
const θ = Math.acos(MathDot([a.x, a.y, a.z], [b.x, b.y, b.z]));
const factor1 = Math.sin(θ * (1 - s)) / Math.sin(θ);
const factor2 = Math.sin(θ * s) / Math.sin(θ);
return new Vector(a.x * factor1 + b.x * factor2, a.y * factor1 + b.y * factor2, a.z * factor1 + b.z * factor2);
return new _a(a.x * factor1 + b.x * factor2, a.y * factor1 + b.y * factor2, a.z * factor1 + b.z * factor2);
}
/**
* @remarks
Expand All @@ -220,7 +220,7 @@ export class Vector {
* @returns {Vector}
*/
static subtract(a, b) {
const vector = new Vector(a.x, a.y, a.z);
const vector = new _a(a.x, a.y, a.z);
vector.x -= b.x;
vector.y -= b.y;
vector.z -= b.z;
Expand Down

0 comments on commit ba6ded0

Please sign in to comment.