Single module modding
This commit is contained in:
@@ -24,7 +24,7 @@ function deep_mod() {
|
||||
name: "Deep",
|
||||
version: "1.0.0",
|
||||
dependencies: [{ id: "bworld", version: "*" }],
|
||||
scripts: { worldgen: "scripts/worldgen.ts", server: "scripts/server.ts" },
|
||||
main: "scripts/main.ts",
|
||||
});
|
||||
write("worldgen/biomes/caves.json", {
|
||||
format_version: 1,
|
||||
@@ -49,21 +49,18 @@ function deep_mod() {
|
||||
},
|
||||
});
|
||||
write(
|
||||
"scripts/worldgen.ts",
|
||||
`import type { WorldgenContext } from "cubi/worldgen";
|
||||
export function setup(gen: WorldgenContext) {
|
||||
"scripts/main.ts",
|
||||
`import type { ServerContext } from "cubi/server";
|
||||
import type { WorldgenContext } from "cubi/worldgen";
|
||||
export function worldgen(gen: WorldgenContext) {
|
||||
gen.register_feature("deep:look", (chunk) => {
|
||||
if (chunk.x !== 0 || chunk.z !== 0) return;
|
||||
const ground = chunk.height_at(8, 8);
|
||||
(globalThis as any).deep_seen = [chunk.biome_at(8, ground, 8), chunk.biome_at(8, ground - 40, 8)];
|
||||
chunk.set_biome(9, 201, 9, "deep:caves");
|
||||
});
|
||||
}`,
|
||||
);
|
||||
write(
|
||||
"scripts/server.ts",
|
||||
`import type { ServerContext } from "cubi/server";
|
||||
export function setup(ctx: ServerContext) {
|
||||
}
|
||||
export function server(ctx: ServerContext) {
|
||||
(globalThis as any).deep_ctx = ctx;
|
||||
}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user