From 92e7ec1c72080b0ce9a3f2f5251a9f0f25d1eefb Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Thu, 4 Sep 2025 19:35:11 -0600 Subject: [PATCH] Prevent item creation and hide the item tab --- module/documents/Item.mjs | 7 +++++++ module/hooks/init.mjs | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 module/documents/Item.mjs diff --git a/module/documents/Item.mjs b/module/documents/Item.mjs new file mode 100644 index 0000000..683187e --- /dev/null +++ b/module/documents/Item.mjs @@ -0,0 +1,7 @@ +const { Item } = foundry.documents; + +export class TAFItem extends Item { + async _preCreate() { + return false; + }; +}; diff --git a/module/hooks/init.mjs b/module/hooks/init.mjs index e57a6c6..ecf09b9 100644 --- a/module/hooks/init.mjs +++ b/module/hooks/init.mjs @@ -6,6 +6,7 @@ import { PlayerData } from "../data/Player.mjs"; // Documents import { TAFActor } from "../documents/Actor.mjs"; +import { TAFItem } from "../documents/Item.mjs"; import { TAFTokenDocument } from "../documents/Token.mjs"; // Settings @@ -25,6 +26,10 @@ Hooks.on(`init`, () => { CONFIG.Actor.dataModels.player = PlayerData; + // We disable items in the system for now + CONFIG.Item.documentClass = TAFItem; + delete CONFIG.ui.sidebar.TABS.items; + foundry.documents.collections.Actors.registerSheet( __ID__, PlayerSheet,