This commit is contained in:
parent
0eb359d9ec
commit
9112a83947
7 changed files with 17 additions and 1719 deletions
BIN
bun.lockb
Executable file
BIN
bun.lockb
Executable file
Binary file not shown.
2
external/OpenSimplex2D.ts
vendored
2
external/OpenSimplex2D.ts
vendored
|
@ -54,8 +54,10 @@ export function makeNoise2D(clientSeed: number): Noise2D {
|
|||
for (let i = 0; i < 256; i++) source[i] = i;
|
||||
let seed = new Uint32Array(1);
|
||||
seed[0] = clientSeed;
|
||||
// @ts-ignore
|
||||
seed = shuffleSeed(shuffleSeed(shuffleSeed(seed)));
|
||||
for (let i = 255; i >= 0; i--) {
|
||||
// @ts-ignore
|
||||
seed = shuffleSeed(seed);
|
||||
const r = new Uint32Array(1);
|
||||
r[0] = (seed[0] + 31) % (i + 1);
|
||||
|
|
2
external/OpenSimplex3D.ts
vendored
2
external/OpenSimplex3D.ts
vendored
|
@ -75,8 +75,10 @@ export function makeNoise3D(clientSeed: number): Noise3D {
|
|||
for (let i = 0; i < 256; i++) source[i] = i;
|
||||
let seed = new Uint32Array(1);
|
||||
seed[0] = clientSeed;
|
||||
// @ts-ignore
|
||||
seed = shuffleSeed(shuffleSeed(shuffleSeed(seed)));
|
||||
for (let i = 255; i >= 0; i--) {
|
||||
// @ts-ignore
|
||||
seed = shuffleSeed(seed);
|
||||
const r = new Uint32Array(1);
|
||||
r[0] = (seed[0] + 31) % (i + 1);
|
||||
|
|
1706
package-lock.json
generated
1706
package-lock.json
generated
File diff suppressed because it is too large
Load diff
18
package.json
18
package.json
|
@ -4,10 +4,9 @@
|
|||
"description": "",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"dev:updateCheck": "check-outdated",
|
||||
"dev:run": "nodemon --watch './**/*.ts' index.ts",
|
||||
"build": "ncc build index.ts -o build",
|
||||
"_clean": "tsc --build --clean"
|
||||
"updateCheck": "check-outdated",
|
||||
"dev": "bun --watch index.ts",
|
||||
"build": "ncc build index.ts -o build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -24,15 +23,12 @@
|
|||
"bufferstuff": "^1.8.0",
|
||||
"dyetty": "^1.0.1",
|
||||
"funky-array": "^1.0.0",
|
||||
"hsconsole": "^1.0.2"
|
||||
"hsconsole": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/bun": "^1.2.8",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"check-outdated": "^2.12.0",
|
||||
"nodemon": "^3.1.9",
|
||||
"ts-loader": "^9.5.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.7.2"
|
||||
"check-outdated": "^2.13.0",
|
||||
"typescript": "^5.8.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ export default class MinecraftServer {
|
|||
|
||||
private config:Config;
|
||||
private server:Server;
|
||||
private readonly serverClock:NodeJS.Timeout;
|
||||
private readonly serverClock:NodeJS.Timer;
|
||||
private tickCounter:number = 0;
|
||||
private clients:FunkyArray<string, MPClient>;
|
||||
public worlds:FunkyArray<number, World>;
|
||||
|
@ -269,7 +269,7 @@ export default class MinecraftServer {
|
|||
mpClient.entity.world.removeEntity(mpClient.entity);
|
||||
this.clients.remove(mpClient.entity.username);
|
||||
this.sendChatMessage(`\u00a7e${mpClient.entity.username} left the game`);
|
||||
if (typeof(err) !== "boolean") {
|
||||
if (err) {
|
||||
Console.printError(`Client disconnected with error: ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@ export default class BlockBehaviourChest extends BlockBehaviour {
|
|||
|
||||
public destroyed(world:World, x:number, y:number, z:number) {
|
||||
const chunk = world.getChunk(x >> 4, z >> 4);
|
||||
const tileEntity = chunk.getTileEntity(x, y, z);
|
||||
if (tileEntity != null) {
|
||||
// TODO: Drop items
|
||||
}
|
||||
chunk.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue