Rename bmod to just mod
This commit is contained in:
@@ -8,7 +8,7 @@ import { GAME_VERSION } from "@/common/constants.ts";
|
||||
import { engine_version_problem, validate_manifest } from "@/common/mod_data.ts";
|
||||
import { ItemStack } from "@/common/inventory.ts";
|
||||
import { EverythingRegistry } from "@/common/everything_registry.ts";
|
||||
import { read_bmod } from "@/common/bmod.ts";
|
||||
import { read_mod } from "@/common/mod.ts";
|
||||
import { load_and_check } from "@/tools/check_mods.ts";
|
||||
import { pack_mod } from "@/tools/pack_mod.ts";
|
||||
import { load_client_mods } from "@/client/mods.ts";
|
||||
@@ -157,7 +157,7 @@ Deno.test({
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test("a client mod hooks LocalPlayer from its .bmod", async () => {
|
||||
Deno.test("a client mod hooks LocalPlayer from its .cubi", async () => {
|
||||
const dir = Deno.makeTempDirSync({ prefix: "bworld_engine_" });
|
||||
write_mod(dir, "floaty", {
|
||||
client: [
|
||||
@@ -175,7 +175,7 @@ Deno.test("a client mod hooks LocalPlayer from its .bmod", async () => {
|
||||
});
|
||||
const mod = load_and_check(dir)[0];
|
||||
assertEquals(mod.report.errors, []);
|
||||
const bmod = read_bmod(await pack_mod(mod), "floaty.bmod");
|
||||
const packed = read_mod(await pack_mod(mod), "floaty.cubi");
|
||||
const listing: ModListing = {
|
||||
id: "floaty",
|
||||
name: "floaty",
|
||||
@@ -186,7 +186,7 @@ Deno.test("a client mod hooks LocalPlayer from its .bmod", async () => {
|
||||
engine_access: true,
|
||||
};
|
||||
EverythingRegistry.clear();
|
||||
await load_client_mods([listing], [bmod]);
|
||||
await load_client_mods([listing], [packed]);
|
||||
|
||||
const client = { options: new Options(), level: {}, connection: { send() {} } };
|
||||
const player = new LocalPlayer(client as unknown as Client, "id", "alice");
|
||||
@@ -337,7 +337,7 @@ Deno.test("hook needs a loading mod with engine access", async () => {
|
||||
assertStringIncludes(String(import_error), `sneaky imports cubi/engine without "engine_access"`);
|
||||
});
|
||||
|
||||
Deno.test("cubi/engine without engine_access is an error in check-mods and in a .bmod", async () => {
|
||||
Deno.test("cubi/engine without engine_access is an error in check-mods and in a .cubi", async () => {
|
||||
const dir = Deno.makeTempDirSync({ prefix: "bworld_engine_" });
|
||||
const script = `import { engine } from "cubi/engine";
|
||||
export function setup() {
|
||||
@@ -351,7 +351,7 @@ Deno.test("cubi/engine without engine_access is an error in check-mods and in a
|
||||
|
||||
// packed anyway, the bundle gives it away
|
||||
const bytes = await pack_mod(mod);
|
||||
assertThrows(() => read_bmod(bytes, "sneaky.bmod"), Error, "a script uses cubi/engine");
|
||||
assertThrows(() => read_mod(bytes, "sneaky.cubi"), Error, "a script uses cubi/engine");
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user