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
+3 -3
View File
@@ -3,9 +3,9 @@
// lighting entities like minecraft: one light level per entity each frame, at its eyes, looked up in the same lightmap
// as terrain and multiplied into its vertex colors. burning ones have full block light
import type { Entity } from "$/client/entity/entity.ts";
import type { ClientLevel } from "$/client/level/client_level.ts";
import { light_color } from "$/client/renderer/mod.ts";
import type { Entity } from "@/client/entity/entity.ts";
import type { ClientLevel } from "@/client/level/client_level.ts";
import { light_color } from "@/client/renderer/mod.ts";
import type { Vec3 } from "./player_renderer.ts";
// the color for the light at a point, times tint (like the hurt flash)
+8 -8
View File
@@ -5,14 +5,14 @@
// animation files yet: the model turns to the entity's yaw, a bone named "head" to where it looks, and bones named
// like minecraft's humanoid ones (right_arm, left_arm, right_leg, left_leg) swing as it walks, the right arm when it
// attacks too. entities without a model are their texture facing the camera, like minecraft's fishing hook
import { AssetManager } from "$/client/assets.ts";
import type { Camera } from "$/client/camera.ts";
import type { RemoteEntity } from "$/client/entity/remote_entity.ts";
import { push_vertex, type Texture } from "$/client/renderer/mod.ts";
import { get_sprite_region } from "$/client/sprites.ts";
import type { SpriteRegion } from "$/common/constants.ts";
import { EverythingRegistry } from "$/common/everything_registry.ts";
import type { EntityBoneJson, EntityJson, EntityModelJson } from "$/common/mod_data.ts";
import { AssetManager } from "@/client/assets.ts";
import type { Camera } from "@/client/camera.ts";
import type { RemoteEntity } from "@/client/entity/remote_entity.ts";
import { push_vertex, type Texture } from "@/client/renderer/mod.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import type { SpriteRegion } from "@/common/constants.ts";
import { EverythingRegistry } from "@/common/everything_registry.ts";
import type { EntityBoneJson, EntityJson, EntityModelJson } from "@/common/mod_data.ts";
import { HURT_TINT } from "./player_renderer.ts";
import { IDENTITY, model_pivot, multiply, rotation_around, type Vec3 } from "./model_math.ts";
import { push_model } from "./model_renderer.ts";
+8 -8
View File
@@ -1,9 +1,9 @@
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { Client } from "$/client/client.ts";
import type { Camera } from "$/client/camera.ts";
import type { ClientLevel } from "$/client/level/client_level.ts";
import type { Client } from "@/client/client.ts";
import type { Camera } from "@/client/camera.ts";
import type { ClientLevel } from "@/client/level/client_level.ts";
import {
begin_mode_3d,
canvas,
@@ -12,14 +12,14 @@ import {
end_mode_3d,
set_render_time,
update_lightmap,
} from "$/client/renderer/mod.ts";
import { daylight } from "$/common/time.ts";
import { Hud } from "$/client/gui/hud.ts";
import { DebugOverlay } from "$/client/gui/debug_overlay.ts";
} from "@/client/renderer/mod.ts";
import { daylight } from "@/common/time.ts";
import { Hud } from "@/client/gui/hud.ts";
import { DebugOverlay } from "@/client/gui/debug_overlay.ts";
import { LevelRenderer } from "./level_renderer.ts";
import { HandRenderer } from "./hand_renderer.ts";
import { render_nameplates } from "./nameplate_renderer.ts";
import { profiler } from "$/client/profiler.ts";
import { profiler } from "@/client/profiler.ts";
// the sky at noon and in the middle of the night
const DAY_SKY = [0.69, 0.8, 1];
+1 -1
View File
@@ -6,7 +6,7 @@
// they wear, like their curios. the gui has no depth buffer, so the faces are drawn back to front with the ones facing
// away left out, like 3d items in slots
import { push_vertex, type Texture, use_texture } from "../renderer/mod.ts";
import type { ItemStack } from "$/common/inventory.ts";
import type { ItemStack } from "@/common/inventory.ts";
import { AssetManager } from "../assets.ts";
import { rotation_around } from "./model_math.ts";
import { part_point, PARTS, type PlayerPose, pose_at, pose_to_world, SLIM_PARTS } from "./player_model.ts";
+4 -4
View File
@@ -5,9 +5,9 @@
// ItemInHandRenderer. with empty hands it's their right arm, in their skin, like minecraft's
// FirstPersonHandsAndItemsRenderer.renderPlayerArm
import { mat4, vec3 } from "gl-matrix";
import type { ItemStack } from "$/common/inventory.ts";
import { AssetManager } from "$/client/assets.ts";
import type { LocalPlayer } from "$/client/entity/local_player.ts";
import type { ItemStack } from "@/common/inventory.ts";
import { AssetManager } from "@/client/assets.ts";
import type { LocalPlayer } from "@/client/entity/local_player.ts";
import {
begin_view_model,
end_mode_3d,
@@ -15,7 +15,7 @@ import {
set_current_texture,
Texture,
use_texture,
} from "$/client/renderer/mod.ts";
} from "@/client/renderer/mod.ts";
import { display_transform, drawn_as_model, item_model_of, push_item } from "./item_renderer.ts";
import { push_cube, type Vec3 } from "./player_renderer.ts";
import { right_arm } from "./player_model.ts";
+2 -2
View File
@@ -3,8 +3,8 @@
// the 3d model of a flat item, like minecraft's item/generated: its sprite on the front and back, one pixel apart, with
// a side face along every edge between a pixel that can be seen and one that can't (or the sprite's border)
import { TEXTURE_SIZE } from "$/common/constants.ts";
import { opaque_pixels, type OpaqueMask } from "$/client/atlas.ts";
import { TEXTURE_SIZE } from "@/common/constants.ts";
import { opaque_pixels, type OpaqueMask } from "@/client/atlas.ts";
export interface ItemQuad {
// 4 corners counter clockwise seen from outside. x from -0.5 to 0.5 and y from 0 to 1 across the sprite, z its
+15 -15
View File
@@ -2,15 +2,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { mat4, vec3 } from "gl-matrix";
import type { SpriteRegion } from "$/common/constants.ts";
import { BlockRegistry, EverythingRegistry, type ItemLayer, ItemRegistry } from "$/common/everything_registry.ts";
import { AssetManager } from "$/client/assets.ts";
import { get_sprite_region } from "$/client/sprites.ts";
import type { ItemEntity } from "$/client/entity/item_entity.ts";
import { contained_fluid, type ItemData, ItemStack } from "$/common/inventory.ts";
import type { FluidVariant } from "$/common/mod_api/shared.ts";
import type { FluidJson } from "$/common/mod_data.ts";
import { light_color, push_vertex, Texture } from "$/client/renderer/mod.ts";
import type { SpriteRegion } from "@/common/constants.ts";
import { BlockRegistry, EverythingRegistry, type ItemLayer, ItemRegistry } from "@/common/everything_registry.ts";
import { AssetManager } from "@/client/assets.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import type { ItemEntity } from "@/client/entity/item_entity.ts";
import { contained_fluid, type ItemData, ItemStack } from "@/common/inventory.ts";
import type { FluidVariant } from "@/common/mod_api/shared.ts";
import type { FluidJson } from "@/common/mod_data.ts";
import { light_color, push_vertex, Texture } from "@/client/renderer/mod.ts";
import {
bake_model,
type BakedQuad,
@@ -24,15 +24,15 @@ import {
item_tint,
type ModelDisplay,
type ModelJson,
} from "$/common/block_models.ts";
} from "@/common/block_models.ts";
import { item_model, type ItemQuad } from "./item_model.ts";
import { get_state_value, item_texture } from "$/common/utils.ts";
import { ID_MASK, TEXTURE_SIZE } from "$/common/constants.ts";
import type { ClientLevel } from "$/client/level/client_level.ts";
import { get_state_value, item_texture } from "@/common/utils.ts";
import { ID_MASK, TEXTURE_SIZE } from "@/common/constants.ts";
import type { ClientLevel } from "@/client/level/client_level.ts";
import { entity_tint } from "./entity_light.ts";
import type { Vec3 } from "./player_renderer.ts";
import { fluid_rules } from "$/client/fluid_rules.ts";
import { color_rgb, tint_without_biome, type TintColor } from "$/common/worldgen/biome_colors.ts";
import { fluid_rules } from "@/client/fluid_rules.ts";
import { color_rgb, tint_without_biome, type TintColor } from "@/common/worldgen/biome_colors.ts";
// how big items on the ground are drawn, minecraft's ground transform
const BLOCK_SCALE = 0.25;
+18 -18
View File
@@ -1,15 +1,15 @@
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
import { type Chunk, CHUNK_SIZE, type ChunkMesh, ClientLevel } from "$/client/level/client_level.ts";
import { profiler } from "$/client/profiler.ts";
import { Camera } from "$/client/camera.ts";
import { AssetManager } from "$/client/assets.ts";
import { get_sprite_region } from "$/client/sprites.ts";
import type { MultiPlayerGameMode } from "$/client/game_mode.ts";
import type { Entity } from "$/client/entity/entity.ts";
import { RemotePlayer } from "$/client/entity/remote_player.ts";
import { ItemEntity } from "$/client/entity/item_entity.ts";
import { type Chunk, CHUNK_SIZE, type ChunkMesh, ClientLevel } from "@/client/level/client_level.ts";
import { profiler } from "@/client/profiler.ts";
import { Camera } from "@/client/camera.ts";
import { AssetManager } from "@/client/assets.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import type { MultiPlayerGameMode } from "@/client/game_mode.ts";
import type { Entity } from "@/client/entity/entity.ts";
import { RemotePlayer } from "@/client/entity/remote_player.ts";
import { ItemEntity } from "@/client/entity/item_entity.ts";
import { render_block_items, render_item_entity } from "./item_renderer.ts";
import { HURT_TINT, player_pose, render_player } from "./player_renderer.ts";
import { render_worn } from "./worn_renderer.ts";
@@ -17,7 +17,7 @@ import type { PlayerPose } from "./player_model.ts";
import type { Vec3 } from "./model_math.ts";
import { render_mod_entity } from "./entity_renderer.ts";
import { entity_tint } from "./entity_light.ts";
import { RemoteEntity } from "$/client/entity/remote_entity.ts";
import { RemoteEntity } from "@/client/entity/remote_entity.ts";
import {
draw_terrain,
flush_batch,
@@ -28,14 +28,14 @@ import {
use_texture,
view_projection,
white_tex,
} from "$/client/renderer/mod.ts";
import { type BlockRegistry, EverythingRegistry, type RenderLayer } from "$/common/everything_registry.ts";
import { bake_block, type BakedQuad, FACE_INDEX, looks_by_state, type ModelJson } from "$/common/block_models.ts";
import { BREAK_STAGES, ID_MASK } from "$/common/constants.ts";
import { type Shape, shape_at } from "$/common/block_shapes.ts";
import type { BlockHitResult } from "$/client/level/client_level.ts";
import { FACE_GROUPS, UNALIGNED_GROUP } from "$/client/workers/chunk_messages.ts";
import { FACE_AXIS, FACE_NORMALS } from "$/client/workers/translucent_sort.ts";
} from "@/client/renderer/mod.ts";
import { type BlockRegistry, EverythingRegistry, type RenderLayer } from "@/common/everything_registry.ts";
import { bake_block, type BakedQuad, FACE_INDEX, looks_by_state, type ModelJson } from "@/common/block_models.ts";
import { BREAK_STAGES, ID_MASK } from "@/common/constants.ts";
import { type Shape, shape_at } from "@/common/block_shapes.ts";
import type { BlockHitResult } from "@/client/level/client_level.ts";
import { FACE_GROUPS, UNALIGNED_GROUP } from "@/client/workers/chunk_messages.ts";
import { FACE_AXIS, FACE_NORMALS } from "@/client/workers/translucent_sort.ts";
import { Frustum } from "./frustum.ts";
import { draw_visuals } from "./visuals.ts";
+1 -1
View File
@@ -3,7 +3,7 @@
// turning and moving the parts of models: entity models' bones, the player's parts and what's worn on them. no
// drawing here, so tests can use it
import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts";
import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts";
export type Vec3 = [number, number, number];
+3 -3
View File
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// entity models' boxes, for mod entities and for what players wear. the atlas has to be the current texture
import type { Texture } from "$/client/renderer/mod.ts";
import type { SpriteRegion } from "$/common/constants.ts";
import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts";
import type { Texture } from "@/client/renderer/mod.ts";
import type { SpriteRegion } from "@/common/constants.ts";
import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts";
import { apply, bone_matrices, type Matrix, type Vec3 } from "./model_math.ts";
import { push_box, type VertexSink } from "./player_renderer.ts";
+5 -5
View File
@@ -1,11 +1,11 @@
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { Camera } from "$/client/camera.ts";
import type { Entity } from "$/client/entity/entity.ts";
import type { ClientLevel } from "$/client/level/client_level.ts";
import { RemotePlayer } from "$/client/entity/remote_player.ts";
import { draw_rect_3d, draw_text_3d, flush_batch, measure_text, type Plane3d } from "$/client/renderer/mod.ts";
import type { Camera } from "@/client/camera.ts";
import type { Entity } from "@/client/entity/entity.ts";
import type { ClientLevel } from "@/client/level/client_level.ts";
import { RemotePlayer } from "@/client/entity/remote_player.ts";
import { draw_rect_3d, draw_text_3d, flush_batch, measure_text, type Plane3d } from "@/client/renderer/mod.ts";
// how big a font pixel is, in blocks. m6x11's letters are 11 pixels tall, so about a quarter of a block
const SCALE = 0.022;
+3 -3
View File
@@ -3,9 +3,9 @@
// minecraft's player model and how it's posed each frame, for drawing players and what they wear. no drawing here, so
// tests can use it
import { PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT } from "$/common/constants.ts";
import { PLAYER_PARTS, type WornProperties } from "$/common/everything_registry.ts";
import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts";
import { PLAYER_HEIGHT, PLAYER_SWIM_HEIGHT } from "@/common/constants.ts";
import { PLAYER_PARTS, type WornProperties } from "@/common/everything_registry.ts";
import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts";
import { apply, IDENTITY, type Matrix, multiply, rotation_around, type Vec3 } from "./model_math.ts";
export type PartName = typeof PLAYER_PARTS[number];
+2 -2
View File
@@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
import type { Player } from "$/client/entity/player.ts";
import { push_vertex, type Texture } from "$/client/renderer/mod.ts";
import type { Player } from "@/client/entity/player.ts";
import { push_vertex, type Texture } from "@/client/renderer/mod.ts";
import type { Vec3 } from "./model_math.ts";
import {
type ModelPart,
+9 -9
View File
@@ -2,20 +2,20 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { mat4, vec3 } from "gl-matrix";
import { SLOT_SIZE } from "$/common/constants.ts";
import { get_sprite_region } from "$/client/sprites.ts";
import { BlockRegistry, EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts";
import { AssetManager } from "$/client/assets.ts";
import { ItemStack } from "$/common/inventory.ts";
import type { FluidVariant } from "$/common/mod_api/shared.ts";
import { item_texture } from "$/common/utils.ts";
import { SLOT_SIZE } from "@/common/constants.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import { BlockRegistry, EverythingRegistry, ItemRegistry } from "@/common/everything_registry.ts";
import { AssetManager } from "@/client/assets.ts";
import { ItemStack } from "@/common/inventory.ts";
import type { FluidVariant } from "@/common/mod_api/shared.ts";
import { item_texture } from "@/common/utils.ts";
import {
cube_face_texture,
cube_face_tint,
type DisplayTransform,
ITEM_FACE_SHADE,
item_tint,
} from "$/common/block_models.ts";
} from "@/common/block_models.ts";
import {
display_matrix,
fluid_look,
@@ -34,7 +34,7 @@ import {
push_vertex,
Texture,
use_texture,
} from "$/client/renderer/mod.ts";
} from "@/client/renderer/mod.ts";
// the corners keep their size (times scale), the edges stretch along and the middle fills the rest, like minecraft's
// nine slice gui sprites. borders are in source pixels
+9 -9
View File
@@ -16,8 +16,8 @@ import type {
TransformedInstance,
Visual,
VisualBlock,
} from "$/common/mod_api/client.ts";
import { type BlockRegistry, EverythingRegistry } from "$/common/everything_registry.ts";
} from "@/common/mod_api/client.ts";
import { type BlockRegistry, EverythingRegistry } from "@/common/everything_registry.ts";
import {
bake_block,
bake_model,
@@ -27,11 +27,11 @@ import {
type ModelElementJson,
type ModelJson,
states_of,
} from "$/common/block_models.ts";
import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "$/common/constants.ts";
import type { ModelFace } from "$/common/mod_data.ts";
import { ItemStack } from "$/common/inventory.ts";
import { chunk_key, item_texture } from "$/common/utils.ts";
} from "@/common/block_models.ts";
import { CHUNK_AREA, CHUNK_SIZE, ID_MASK } from "@/common/constants.ts";
import type { ModelFace } from "@/common/mod_data.ts";
import { ItemStack } from "@/common/inventory.ts";
import { chunk_key, item_texture } from "@/common/utils.ts";
import {
create_vertex_buffer,
destroy_buffer,
@@ -40,8 +40,8 @@ import {
MODEL_VERTEX_BYTES,
type Texture,
write_buffer,
} from "$/client/renderer/mod.ts";
import { get_sprite_region } from "$/client/sprites.ts";
} from "@/client/renderer/mod.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import { fluid_look, ground_transform, item_layers, push_item, sprite_u, sprite_v } from "./item_renderer.ts";
export interface VisualRegistration {
+7 -7
View File
@@ -4,13 +4,13 @@
// what players wear, like curios' render layer: each worn item's model (see WornProperties) on the player, its bones
// named like the player's parts turned the way those parts are, so it moves with them like minecraft's
// TransformCopyingHumanoidModel. see docs/modding/items/index.md
import { AssetManager } from "$/client/assets.ts";
import type { Player } from "$/client/entity/player.ts";
import type { ItemStack } from "$/common/inventory.ts";
import type { Texture } from "$/client/renderer/mod.ts";
import { get_sprite_region } from "$/client/sprites.ts";
import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts";
import type { EntityBoneJson, EntityModelJson } from "$/common/mod_data.ts";
import { AssetManager } from "@/client/assets.ts";
import type { Player } from "@/client/entity/player.ts";
import type { ItemStack } from "@/common/inventory.ts";
import type { Texture } from "@/client/renderer/mod.ts";
import { get_sprite_region } from "@/client/sprites.ts";
import { EverythingRegistry, type ItemRegistry } from "@/common/everything_registry.ts";
import type { EntityBoneJson, EntityModelJson } from "@/common/mod_data.ts";
import { IDENTITY, type Vec3 } from "./model_math.ts";
import { push_model } from "./model_renderer.ts";
import type { VertexSink } from "./player_renderer.ts";