Skip to content

Commit 92f5677

Browse files
committed
chore: cleanup, re-add data files
1 parent 90435a7 commit 92f5677

File tree

9 files changed

+3214
-8
lines changed

9 files changed

+3214
-8
lines changed

serial.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import fs from 'fs/promises';
2+
import path from 'path';
3+
4+
const biomeRoot = './static/mcmeta/data/minecraft/worldgen/biome';
5+
const biomeDir = await fs.readdir(biomeRoot);
6+
7+
const allBiomes: Record<string, string> = {};
8+
for (const biomeFile of biomeDir) {
9+
const content = await fs.readFile(path.join(biomeRoot, biomeFile), 'utf-8');
10+
allBiomes[path.basename(biomeFile, '.json')] = JSON.parse(content);
11+
}
12+
13+
await fs.writeFile('./static/1.21.8.biomes.json', JSON.stringify(allBiomes));
14+
15+
const noiseRoot = './static/mcmeta/data/minecraft/worldgen/noise';
16+
const noiseDir = await fs.readdir(noiseRoot);
17+
18+
const allNoises: Record<string, string> = {};
19+
for (const noiseFile of noiseDir) {
20+
const content = await fs.readFile(path.join(noiseRoot, noiseFile), 'utf-8');
21+
allNoises[path.basename(noiseFile, '.json')] = JSON.parse(content);
22+
}
23+
24+
await fs.writeFile('./static/1.21.8.noise.json', JSON.stringify(allNoises));
25+
26+
const densityFnRoot = './static/mcmeta/data/minecraft/worldgen/density_function';
27+
const densityFnDir = await fs.readdir(densityFnRoot);
28+
29+
const alldensityFns: Record<string, string> = {};
30+
31+
const addDensityFn = async (root: string, name: string) => {
32+
const p = path.join(root, name);
33+
if ((await fs.stat(p)).isDirectory()) {
34+
for (const child of await fs.readdir(p)) {
35+
addDensityFn(p, child);
36+
}
37+
} else {
38+
const content = await fs.readFile(p, 'utf-8');
39+
alldensityFns[path.basename(name, '.json')] = JSON.parse(content);
40+
}
41+
};
42+
43+
for (const densityFnFile of densityFnDir) {
44+
await addDensityFn(densityFnRoot, densityFnFile);
45+
}
46+
47+
await fs.writeFile('./static/1.21.8.density_functions.json', JSON.stringify(alldensityFns));

src/lib/MMSProject.svelte.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ export class MMSProject {
9191
else message = this.partial;
9292
}
9393
try {
94-
JSON.parse(message);
95-
console.log({ message: JSON.parse(message) });
9694
this.partial = '';
9795
this.lspReaders.forEach((r) => r(message));
9896
} catch (e) {

src/lib/deepslate/worker/deepslate_render_worker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ const previews = {
217217
const chunkKey = JSON.stringify(chunkPos);
218218

219219
if (!chunks.has(chunkKey)) {
220-
console.log('Creating fresh chunk!', chunkPos, [...chunks.keys()]);
221220
const freshChunk = new deepslate.Chunk(minY, worldHeight, chunkPos);
222221
generator.fill(randomState, freshChunk, true);
223222
chunks.set(chunkKey, freshChunk);

src/lib/editor/Help.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
99
onMount(() => {
1010
if (!help) {
11-
console.log('Started getting spec');
1211
const r = getMmsSpec();
13-
console.log('Got Spec', { r });
1412
help = atob(r.toBase64());
1513
}
1614
});

src/lib/editor/Mirror.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@
125125
lspClient.connect({
126126
send(m) {
127127
const msg = JSON.parse(m);
128-
console.log(msg.id, msg.method, { msg });
129-
if (msg.id === undefined) debugger;
130128
editor.project.lspWrite(m);
131129
},
132130
subscribe(h) {

src/lib/editor/PreviewPicker.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
{selectedPath}
6262
label={fs.name}
6363
onclick={() => {
64-
console.log({ path });
6564
editor.selectedPreview = { path, source: 'file' };
6665
}}
6766
/>

static/1.21.8.biomes.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

static/1.21.8.density_functions.json

Lines changed: 3165 additions & 0 deletions
Large diffs are not rendered by default.

static/1.21.8.noise.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"erosion":{"amplitudes":[1,1,0,1,1],"firstOctave":-9},"spaghetti_2d_thickness":{"amplitudes":[1],"firstOctave":-11},"spaghetti_3d_2":{"amplitudes":[1],"firstOctave":-7},"spaghetti_roughness_modulator":{"amplitudes":[1],"firstOctave":-8},"nether_wart":{"amplitudes":[1,0,0,0.9],"firstOctave":-3},"ore_vein_a":{"amplitudes":[1],"firstOctave":-7},"continentalness_large":{"amplitudes":[1,1,2,2,2,1,1,1,1],"firstOctave":-11},"surface":{"amplitudes":[1,1,1],"firstOctave":-6},"badlands_pillar":{"amplitudes":[1,1,1,1],"firstOctave":-2},"ridge":{"amplitudes":[1,2,1,0,0,0],"firstOctave":-7},"gravel":{"amplitudes":[1,1,1,1],"firstOctave":-8},"erosion_large":{"amplitudes":[1,1,0,1,1],"firstOctave":-11},"spaghetti_2d":{"amplitudes":[1],"firstOctave":-7},"cave_layer":{"amplitudes":[1],"firstOctave":-8},"surface_swamp":{"amplitudes":[1],"firstOctave":-2},"iceberg_pillar_roof":{"amplitudes":[1],"firstOctave":-3},"soul_sand_layer":{"amplitudes":[1,1,1,1,0,0,0,0,0.013333333333333334],"firstOctave":-8},"gravel_layer":{"amplitudes":[1,1,1,1,0,0,0,0,0.013333333333333334],"firstOctave":-8},"spaghetti_3d_rarity":{"amplitudes":[1],"firstOctave":-11},"spaghetti_3d_thickness":{"amplitudes":[1],"firstOctave":-8},"noodle_ridge_b":{"amplitudes":[1],"firstOctave":-7},"noodle_thickness":{"amplitudes":[1],"firstOctave":-8},"pillar_rareness":{"amplitudes":[1],"firstOctave":-8},"spaghetti_2d_modulator":{"amplitudes":[1],"firstOctave":-11},"badlands_surface":{"amplitudes":[1,1,1],"firstOctave":-6},"temperature_large":{"amplitudes":[1.5,0,1,0,0,0],"firstOctave":-12},"iceberg_surface":{"amplitudes":[1,1,1],"firstOctave":-6},"cave_entrance":{"amplitudes":[0.4,0.5,1],"firstOctave":-7},"surface_secondary":{"amplitudes":[1,1,0,1],"firstOctave":-6},"ice":{"amplitudes":[1,1,1,1],"firstOctave":-4},"cave_cheese":{"amplitudes":[0.5,1,2,1,2,1,0,2,0],"firstOctave":-8},"noodle_ridge_a":{"amplitudes":[1],"firstOctave":-7},"powder_snow":{"amplitudes":[1,1,1,1],"firstOctave":-6},"iceberg_pillar":{"amplitudes":[1,1,1,1],"firstOctave":-6},"temperature":{"amplitudes":[1.5,0,1,0,0,0],"firstOctave":-10},"badlands_pillar_roof":{"amplitudes":[1],"firstOctave":-8},"pillar_thickness":{"amplitudes":[1],"firstOctave":-8},"offset":{"amplitudes":[1,1,1,0],"firstOctave":-3},"clay_bands_offset":{"amplitudes":[1],"firstOctave":-8},"aquifer_fluid_level_spread":{"amplitudes":[1],"firstOctave":-5},"ore_veininess":{"amplitudes":[1],"firstOctave":-8},"jagged":{"amplitudes":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"firstOctave":-16},"aquifer_fluid_level_floodedness":{"amplitudes":[1],"firstOctave":-7},"ore_gap":{"amplitudes":[1],"firstOctave":-5},"calcite":{"amplitudes":[1,1,1,1],"firstOctave":-9},"spaghetti_2d_elevation":{"amplitudes":[1],"firstOctave":-8},"spaghetti_roughness":{"amplitudes":[1],"firstOctave":-5},"patch":{"amplitudes":[1,0,0,0,0,0.013333333333333334],"firstOctave":-5},"nether_state_selector":{"amplitudes":[1],"firstOctave":-4},"continentalness":{"amplitudes":[1,1,2,2,2,1,1,1,1],"firstOctave":-9},"aquifer_barrier":{"amplitudes":[1],"firstOctave":-3},"ore_vein_b":{"amplitudes":[1],"firstOctave":-7},"vegetation":{"amplitudes":[1,1,0,0,0,0],"firstOctave":-8},"aquifer_lava":{"amplitudes":[1],"firstOctave":-1},"vegetation_large":{"amplitudes":[1,1,0,0,0,0],"firstOctave":-10},"netherrack":{"amplitudes":[1,0,0,0.35],"firstOctave":-3},"spaghetti_3d_1":{"amplitudes":[1],"firstOctave":-7},"packed_ice":{"amplitudes":[1,1,1,1],"firstOctave":-7},"pillar":{"amplitudes":[1,1],"firstOctave":-7},"noodle":{"amplitudes":[1],"firstOctave":-8}}

0 commit comments

Comments
 (0)