Actually implement mod code into server

This commit is contained in:
2026-09-25 23:13:46 -03:00
parent 099811670f
commit 9237152aa1
22 changed files with 1359 additions and 457 deletions
+8 -4
View File
@@ -49,7 +49,7 @@ export class ContainerSlot {
#item_stack: ItemStack | undefined;
has_item() {
return this.#item_stack !== undefined;
return this.get_item() !== undefined;
}
set_item(item_stack: ItemStack | undefined) {
@@ -60,11 +60,15 @@ export class ContainerSlot {
}
get_item() {
// scripts can count a stack down to nothing, it's gone then
if (this.#item_stack && this.#item_stack.amount <= 0) {
this.#item_stack = undefined;
}
return this.#item_stack;
}
get type_id() {
return this.#item_stack?.type_id;
return this.get_item()?.type_id;
}
set amount(new_amount: number) {
@@ -77,11 +81,11 @@ export class ContainerSlot {
}
get amount(): number | undefined {
return this.#item_stack?.amount;
return this.get_item()?.amount;
}
get max_amount() {
return this.#item_stack?.max_amount;
return this.get_item()?.max_amount;
}
}