import type { IFluid } from '../infobook/IFluid'; import type { IItem } from '../infobook/IItem'; /** * Allows Minecraft resources to be used. */ export declare class ResourceHandler { private static readonly translationDefaults; private readonly translations; private readonly languages; private readonly resourcePackBasePaths; private readonly iconsItem; private readonly itemTranslationKeys; private readonly iconsFluid; private readonly fluidTranslationKeys; private readonly advancements; private readonly keybindings; /** * Split an item id like "minecraft:stone" into namespace an path. * @param {string} itemId An item id. * @returns {{namespace: string; path: string}} Namespace and path. */ static splitItemId(itemId: string): { namespace: string; path: string; }; /** * Add an entry to a {@llink IItemKeyedRegistry}. * @param {IItemKeyedRegistry} registry The registry. * @param {string} namespace The namespace. * @param {string} path The path. * @param {string} nbt The NBT. (empty string represents no NBT) * @param {string} value The value. */ protected static addItemKeyedRegistryEntry(registry: IItemKeyedRegistry, namespace: string, path: string, nbt: string, value: string): void; /** * Get an value from a {@llink IItemKeyedRegistry}. * @param {IItemKeyedRegistry} registry The registry. * @param {string} namespace The namespace. * @param {string} path The path. * @param {string} nbt The NBT. (empty string represents no NBT) * @return The value. */ protected static getItemKeyedRegistryEntry(registry: IItemKeyedRegistry, namespace: string, path: string, nbt?: string): string; /** * @returns {string[]} All available language keys. */ getLanguages(): string[]; /** * Add translations for the given language. * @param {string} language A language key. * @param {{[p: string]: string}} translations A mapping from translation key to translated value. */ addTranslations(language: string, translations: Record, excludedModLanguage: boolean): void; /** * Get the translation for the given key. * @param {string} translationKey A translation key. * @param {string} languageKey A language key. * @returns {string} A translated value. */ getTranslation(translationKey: string, languageKey: string): string; /** * Set the base path for resource keys. * @param {string} resourcePackId A resource pack id. * @param {string} basePath An absolute base path. */ setResourcePackBasePath(resourcePackId: string, basePath: string): void; /** * Get the full path corresponding to a resource key. * @param {string} resourceKey A resource key. * @returns {string} A full file path. */ expandResourcePath(resourceKey: string): string; /** * Add an item icon file. * @param {string} namespace The icon namespace. * @param {string} path The icon path. * @param {string} nbt The icon NBT. (empty string represents no NBT) * @param {string} file The icon file path. */ addItemIcon(namespace: string, path: string, nbt: string, file: string): void; /** * Get an item icon file. * @param {string} itemId The icon namespace:path. * @param {string} nbt The icon NBT. (empty string represents no NBT) * @return The icon file path or null. */ getItemIconFile(itemId: string, nbt?: string): string; /** * Add a fluid icon file. * @param {string} fluidName The fluid name. * @param {string} file The icon file path. */ addFluidIcon(fluidName: string, file: string): void; /** * Get a fluid icon file. * @param {string} fluidName The fluid name. * @return The icon file path or null. */ getFluidIconFile(fluidName: string): string; /** * Add an item translation key. * @param {IItem} item An item. * @param {string} translationKey The translation key. */ addItemTranslationKey(item: IItem, translationKey: string): void; /** * Get an item translation key. * @param {IItem} item An item. * @return The translation key or null. */ getItemTranslationKey(item: IItem): string; /** * Add an fluid translation key. * @param {IFluid} fluid An fluid. * @param {string} translationKey The translation key. */ addFluidTranslationKey(fluid: IFluid, translationKey: string): void; /** * Get an fluid translation key. * @param {IFluid} fluid An fluid. * @return The translation key or null. */ getFluidTranslationKey(fluid: IFluid): string; /** * Add an advancement. * @param {IAdvancement} advancement An advancement. * @param {string} id An advancement id. */ addAdvancement(advancement: IAdvancement, id: string): void; /** * Get an advancement. * @param {string} id An advancement id. * @return The advancement. */ getAdvancement(id: string): IAdvancement; /** * Add an keybinding. * @param {string} id A keybinding id. * @param {string} keybinding An keybinding. */ addKeybinding(id: string, keybinding: string): void; /** * Get a keybinding. * @param {string} id A keybinding id. * @return The keybinding. */ getKeybinding(id: string): string; } export type IItemKeyedRegistry = Record>>; export interface IAdvancement { itemIcon: IItem; title: string; description: string; }