Implement main game as a mod
This commit is contained in:
+3
-3
@@ -13,12 +13,12 @@ export class ItemStack<T = unknown | undefined> {
|
||||
max_amount: number;
|
||||
data?: T;
|
||||
|
||||
constructor(type_id: string | string, amount: number = 1, max_amount: number = 64) {
|
||||
constructor(type_id: string | string, amount: number = 1, max_amount?: number) {
|
||||
const item_info = EverythingRegistry.get<ItemRegistry>("items", type_id);
|
||||
this.type_id = type_id;
|
||||
this.amount = amount;
|
||||
this.max_amount = max_amount;
|
||||
this.max_amount = max_amount ?? item_info?.max_stack ?? 64;
|
||||
this.data = undefined;
|
||||
const item_info = EverythingRegistry.get<ItemRegistry>("items", type_id);
|
||||
if (item_info?.on_create) {
|
||||
item_info.on_create(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user