Change imports

This commit is contained in:
2026-11-04 21:51:26 -03:00
parent 98fa45ebd1
commit ba4b2a8798
270 changed files with 994 additions and 994 deletions
+12 -12
View File
@@ -22,20 +22,20 @@ import {
validate_recipe,
validate_spawn,
validate_tag,
} from "$/common/mod_data.ts";
import { json_object } from "$/common/schema.ts";
import { check_references, load_order, type LoadedMod, type ModReport } from "$/common/mod_check.ts";
import { png_size, texture_size_problem } from "$/common/bmod.ts";
import { type TextureJson, validate_texture_json } from "$/common/texture_animation.ts";
import { type LootTableJson, validate_loot_table } from "$/common/loot.ts";
import { validate_biome } from "$/common/worldgen/biomes.ts";
} from "@/common/mod_data.ts";
import { json_object } from "@/common/schema.ts";
import { check_references, load_order, type LoadedMod, type ModReport } from "@/common/mod_check.ts";
import { png_size, texture_size_problem } from "@/common/bmod.ts";
import { type TextureJson, validate_texture_json } from "@/common/texture_animation.ts";
import { type LootTableJson, validate_loot_table } from "@/common/loot.ts";
import { validate_biome } from "@/common/worldgen/biomes.ts";
import {
validate_biome_source,
validate_density_function,
validate_noise,
validate_noise_settings,
} from "$/common/worldgen/data.ts";
import { validate_feature } from "$/common/worldgen/features.ts";
} from "@/common/worldgen/data.ts";
import { validate_feature } from "@/common/worldgen/features.ts";
import { dirname } from "@std/path";
export { load_order, type LoadedMod, type ModReport };
@@ -125,14 +125,14 @@ function load_mod(mods_dir: string, id: string): LoadedMod {
error(`manifest.json: scripts.${side} ${path} doesn't exist`);
}
}
// bworld/engine needs engine_access, it's checked again on the bundled code when a .bmod loads
// cubi/engine needs engine_access, it's checked again on the bundled code when a .bmod loads
if (mod.manifest?.engine_access !== true) {
const folders = new Set(Object.values(scripts).filter((p) => typeof p === "string").map((p) => dirname(p)));
for (const folder of folders) {
for (const file of [...walk(`${dir}/${folder}`, ".ts"), ...walk(`${dir}/${folder}`, ".js")]) {
if (/["']bworld\/engine["']/.test(Deno.readTextFileSync(`${dir}/${folder}/${file}`))) {
if (/["']cubi\/engine["']/.test(Deno.readTextFileSync(`${dir}/${folder}/${file}`))) {
error(
`${folder}/${file} imports bworld/engine, which needs "engine_access": true in manifest.json`,
`${folder}/${file} imports cubi/engine, which needs "engine_access": true in manifest.json`,
);
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
// mods set mining, sounds and what blocks do in code), so every block gets the same placeholders: a second to break with
// anything, dropping itself, and what they really have is written by hand after
import { dirname, join } from "@std/path";
import { FORMAT_VERSION } from "$/common/mod_data.ts";
import { FORMAT_VERSION } from "@/common/mod_data.ts";
import { is_empty, made_by, model_source, type ModelSource } from "./models.ts";
import {
DEFAULT_REMAPS,
+1 -1
View File
@@ -6,7 +6,7 @@
// layer0 texture, which is what a bworld item is, and its layer1 and on are its layers. one java draws in 3D (a wrench)
// is drawn with its model, which the model kind writes, and gets its model's particle texture as its texture
import { join } from "@std/path";
import { FORMAT_VERSION } from "$/common/mod_data.ts";
import { FORMAT_VERSION } from "@/common/mod_data.ts";
import { made_by, model_source } from "./models.ts";
import { merged_textures, model_missing, models_near } from "./blocks.ts";
import {
+2 -2
View File
@@ -5,8 +5,8 @@
// bottom instead of up and down, ids lose their folders, a parent keeps being a parent (bworld merges them when it
// loads, see resolve_models), and what bworld has no use for (blockbench's names, display transforms for places bworld
// doesn't show items, like third person) is left out
import type { ModelDisplay, ModelElementJson, ModelFaceJson, ModelFileJson } from "$/common/block_models.ts";
import { DISPLAY_CONTEXTS, FORMAT_VERSION, type ModelFace } from "$/common/mod_data.ts";
import type { ModelDisplay, ModelElementJson, ModelFaceJson, ModelFileJson } from "@/common/block_models.ts";
import { DISPLAY_CONTEXTS, FORMAT_VERSION, type ModelFace } from "@/common/mod_data.ts";
import { join } from "@std/path";
import {
DEFAULT_REMAPS,
+1 -1
View File
@@ -5,7 +5,7 @@
// each type bworld or a ported mod has an equivalent for is converted, the rest are reported. a recipe naming an item or tag that
// doesn't exist here is left out, since bworld's recipes have to be complete
import { join } from "@std/path";
import { FORMAT_VERSION } from "$/common/mod_data.ts";
import { FORMAT_VERSION } from "@/common/mod_data.ts";
import { known_tag, tag_id } from "./tags.ts";
import {
DEFAULT_REMAPS,
+4 -4
View File
@@ -4,10 +4,10 @@
// where things are in a java mod's resources, and what they're called in bworld. a resource location like
// "create:block/cogwheel" (or "block/stone", which is minecraft's) becomes the id "create:block_cogwheel": bworld ids
// have no folders, so the path's folders are joined with _, the same way check_mods names textures in subfolders
import type { TagRegistry } from "$/common/mod_data.ts";
import { ID_PATTERN } from "$/common/schema.ts";
import { registered_ids } from "$/common/mod_check.ts";
import { load_and_check } from "$/tools/check_mods.ts";
import type { TagRegistry } from "@/common/mod_data.ts";
import { ID_PATTERN } from "@/common/schema.ts";
import { registered_ids } from "@/common/mod_check.ts";
import { load_and_check } from "@/tools/check_mods.ts";
import { dirname, relative, resolve, SEPARATOR } from "@std/path";
export interface Location {
+2 -2
View File
@@ -5,8 +5,8 @@
// format is the same: values, replace and remove, with { id, required: false } for entries that can be missing. tag ids
// keep their folders, since bworld's can have them too
import { join } from "@std/path";
import { FORMAT_VERSION, type TagRegistry } from "$/common/mod_data.ts";
import { TAG_ID_PATTERN } from "$/common/schema.ts";
import { FORMAT_VERSION, type TagRegistry } from "@/common/mod_data.ts";
import { TAG_ID_PATTERN } from "@/common/schema.ts";
import {
DEFAULT_REMAPS,
empty_report,
+2 -2
View File
@@ -6,8 +6,8 @@
// converted from the same mod find their textures. a .png.mcmeta becomes the .json next to the png: bworld reads the
// same animation format
import { join } from "@std/path";
import { png_size, texture_size_problem } from "$/common/bmod.ts";
import { type TextureJson, validate_texture_json } from "$/common/texture_animation.ts";
import { png_size, texture_size_problem } from "@/common/bmod.ts";
import { type TextureJson, validate_texture_json } from "@/common/texture_animation.ts";
import {
DEFAULT_REMAPS,
empty_report,
+1 -1
View File
@@ -3,7 +3,7 @@
// deno task new-mod <id> ["Display Name"]
// copies templates/mod into mods/<id>, with the template's placeholder id and name replaced
import { NAMESPACE_PATTERN, RESERVED_NAMESPACES } from "$/common/mod_data.ts";
import { NAMESPACE_PATTERN, RESERVED_NAMESPACES } from "@/common/mod_data.ts";
const TEMPLATE = "templates/mod";
const PLACEHOLDER_ID = "example_mod";
+1 -1
View File
@@ -3,7 +3,7 @@
// measures the percentiles of octave noise, for the "quantiles" of a noise file (worldgen/noise in a mod).
// they only depend on the amplitudes. deno run tools/noise_quantiles.ts '[1,1,2,2,1,1]' '[1,2,1]'
import { OctaveNoise2D } from "$/common/worldgen/noise.ts";
import { OctaveNoise2D } from "@/common/worldgen/noise.ts";
const SAMPLES_PER_SEED = 20000;
const SEEDS = 20;
+3 -3
View File
@@ -5,10 +5,10 @@
// builds a mod folder into a .bmod: its data merged into data.json, each script bundled into one module, and its
// textures and credits. deno task build does this for every mod in mods/, see docs/modding/gettingstarted/modfiles.md
import { basename, dirname, resolve } from "@std/path";
import { type Bmod, BMOD_EXTENSION, SCRIPT_SIDES, type ScriptSide, write_bmod } from "$/common/bmod.ts";
import type { ManifestJson } from "$/common/mod_data.ts";
import { type Bmod, BMOD_EXTENSION, SCRIPT_SIDES, type ScriptSide, write_bmod } from "@/common/bmod.ts";
import type { ManifestJson } from "@/common/mod_data.ts";
import { load_and_check, type LoadedMod, mod_deno_config } from "./check_mods.ts";
import { mod_data } from "$/common/mod_check.ts";
import { mod_data } from "@/common/mod_check.ts";
// what each script is bundled for: the server runs in deno, clients in browsers, worldgen and shared in both
const PLATFORMS: Record<ScriptSide, "deno" | "browser"> = {
+6 -6
View File
@@ -11,12 +11,12 @@
//
// the parts lock their textures to the world (uvlock), so every piece shows the part of the texture under it, the
// texture's line running north to south or its line running east to west, and it lines up from one wire to the next
import { model_shape } from "$/common/block_shapes.ts";
import type { ModelElementJson } from "$/common/block_models.ts";
import type { ModelFace } from "$/common/mod_data.ts";
import type { Face } from "$/common/mod_api/shared.ts";
import { can_cover, ways_out } from "$/mods/bworld/scripts/verdigris/joins.ts";
import { DIRECTIONS, FACE_OFFSETS, FACES } from "$/mods/bworld/scripts/verdigris/sides.ts";
import { model_shape } from "@/common/block_shapes.ts";
import type { ModelElementJson } from "@/common/block_models.ts";
import type { ModelFace } from "@/common/mod_data.ts";
import type { Face } from "@/common/mod_api/shared.ts";
import { can_cover, ways_out } from "@/mods/bworld/scripts/verdigris/joins.ts";
import { DIRECTIONS, FACE_OFFSETS, FACES } from "@/mods/bworld/scripts/verdigris/sides.ts";
const MODELS = "mods/bworld/models";
const BLOCK = "mods/bworld/blocks/verdigris_wire.json";
+5 -5
View File
@@ -6,11 +6,11 @@
// map.png: 4096 blocks across from the terrain's heights and biomes (fast, no caves or 3d noise)
// blocks.png: 768 blocks across from real generated chunks, top block with hill shading
// section.png: a slice down through the world along x, showing caves, overhangs and underground rivers
import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, SEA_LEVEL } from "$/common/constants.ts";
import { generate_raw_chunk } from "$/common/generation.ts";
import { load_worldgen } from "$/common/worldgen_loader.ts";
import { register_mod_data } from "$/common/mod_loader.ts";
import { BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts";
import { CHUNK_AREA, CHUNK_HEIGHT, CHUNK_SIZE, SEA_LEVEL } from "@/common/constants.ts";
import { generate_raw_chunk } from "@/common/generation.ts";
import { load_worldgen } from "@/common/worldgen_loader.ts";
import { register_mod_data } from "@/common/mod_loader.ts";
import { BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts";
import { load_and_check } from "./check_mods.ts";
const seed = Deno.args[0] ?? "preview";