Server
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { System } from "$/common/ecs/mod.ts";
|
||||
import { World } from "$/common/ecs/world.ts";
|
||||
import { Position } from "$/common/components/position.ts";
|
||||
import { AnimatedSprite, Sprite } from "$/client/components/sprite.ts";
|
||||
import { Dimension } from "../components/dimension.ts";
|
||||
@@ -10,13 +9,15 @@ import { render_dimension } from "./rendering/dimension.ts";
|
||||
import { render_player_breaking, render_player_crosshair, render_player_hotbar } from "./rendering/player.ts";
|
||||
import { PlayerComponent } from "../player.ts";
|
||||
import { begin_mode_3d, end_mode_3d } from "../renderer/core.ts";
|
||||
import { ClientWorld } from "../client_world.ts";
|
||||
import { render_chat_log, render_remote_players } from "./rendering/network.ts";
|
||||
|
||||
export class RenderSystem extends System {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
update(world: World, _delta: number): void {
|
||||
update(world: ClientWorld, _delta: number): void {
|
||||
const camera_entity = world.get_entities().values().find((e) => e.get(Camera));
|
||||
const camera = camera_entity?.get(Camera);
|
||||
|
||||
@@ -39,6 +40,10 @@ export class RenderSystem extends System {
|
||||
}
|
||||
}
|
||||
|
||||
if (world.connection) {
|
||||
render_remote_players(world.connection);
|
||||
}
|
||||
|
||||
end_mode_3d();
|
||||
|
||||
for (const entity of world.get_entities()) {
|
||||
@@ -60,5 +65,7 @@ export class RenderSystem extends System {
|
||||
render_player_crosshair();
|
||||
}
|
||||
}
|
||||
|
||||
render_chat_log(world, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user