Curios slots rendering !

This commit is contained in:
2026-10-01 17:57:22 -03:00
parent ea9f3f61bb
commit f2c3cb8135
39 changed files with 1032 additions and 226 deletions
+3
View File
@@ -1,4 +1,5 @@
import { PLAYER_EYE_HEIGHT, PLAYER_HEIGHT, PLAYER_WIDTH } from "$/common/constants.ts";
import { ItemStack } from "$/common/inventory.ts";
import type { ClientLevel } from "../level/client_level.ts";
import type { Texture } from "../renderer/mod.ts";
import { decode_skin } from "../skins.ts";
@@ -15,6 +16,8 @@ export abstract class Player extends Entity {
skin: Texture | undefined;
// 3 pixel wide arms, for skins made for them
slim = false;
// what they wear that shows, items with a worn model, see the server's player_worn
worn: ItemStack[] = [];
#skin_version = 0;
constructor(level: ClientLevel, id: string, name: string) {
+2
View File
@@ -1,5 +1,6 @@
import type { EntityEvent, PlayerInfo } from "$/common/protocol.ts";
import { TICK_DELTA } from "$/common/constants.ts";
import { ItemStack } from "$/common/inventory.ts";
import type { ClientLevel } from "../level/client_level.ts";
import { Player } from "./player.ts";
@@ -27,6 +28,7 @@ export class RemotePlayer extends Player {
if (info.skin) {
this.set_skin(info.skin, info.slim);
}
this.worn = (info.worn ?? []).map(ItemStack.from_data);
}
lerp_to(x: number, y: number, z: number, yaw: number, pitch: number) {