Giant chesplate
This commit is contained in:
@@ -37,7 +37,6 @@ export function register_curios(ctx: ServerContext) {
|
||||
const container = ctx.containers.create(SLOTS.length);
|
||||
const ids = ctx.storage.get<Record<string, string>>("curios") ?? {};
|
||||
ctx.storage.set("curios", { ...ids, [player.name]: container.id });
|
||||
watch(player, container);
|
||||
return container;
|
||||
}
|
||||
|
||||
@@ -63,20 +62,19 @@ export function register_curios(ctx: ServerContext) {
|
||||
applied.set(player.id, now);
|
||||
}
|
||||
|
||||
ctx.events.after.player_join.subscribe(({ player }) => {
|
||||
const curios = saved_curios(player);
|
||||
if (curios) watch(player, curios);
|
||||
});
|
||||
ctx.events.after.player_leave.subscribe(({ player }) => {
|
||||
stop_watching.get(player.id)?.();
|
||||
stop_watching.delete(player.id);
|
||||
applied.delete(player.id);
|
||||
});
|
||||
|
||||
// the slot types in 2 columns left of the inventory, always there while it's open. the engine draws their panel
|
||||
// the slot types in 2 columns left of the inventory, always there while it's open. the engine draws their panel.
|
||||
// this runs as they join, before their health is checked against their max health, so what their curios give them
|
||||
// comes back first
|
||||
ctx.menus.extend_player_menu((menu, player) => {
|
||||
if (active.length === 0) return;
|
||||
const curios = curios_of(player);
|
||||
watch(player, curios);
|
||||
// what's in slot types no item goes in anymore, since the mod that put items in them was removed, goes back
|
||||
// to them
|
||||
for (const [index, slot] of SLOTS.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user