📄
pasted-code-1795285728930.txt
txt
16 lines
▶
Create a Fabric mod for Minecraft 26.3 (Java 25) that adds a built-in GUI shop powered by item values from the "Upgrader items" mod (mod ID: upgrader).
Requirements:
1. Target environment: Minecraft 26.3, Fabric Loader, Java 25, both client and server (`"environment": "*"` in `fabric.mod.json`), with dependency `"upgrader": "*"`.
2. Currency & Persistence:
- Store each player's personal currency balance ("Value Points" / "Очки ценности") persistently in world NBT / `PersistentState` so it saves across restarts.
- Add a `/balance` command to check current points and `/shop` command to open the shop GUI.
3. Integration with "Upgrader items" via Java Reflection:
- Reuse the runtime class/method scanning approach to find the value calculation method inside the `upgrader` mod package (accepting `ItemStack`, `Item`, or `Identifier` and returning a positive number).
4. Shop GUI Features (Server-side `GenericContainerScreenHandler` 6-row chest GUI so no custom client screens are needed):
- **Sell Mode (or Sell Slot / Sell Hand):** Allow players to sell items from their inventory (e.g., `/sellhand`, `/sellall`, or clicking items in their lower inventory while `/shop` is open) to receive `item_value * count` points added to their balance.
- **Buy Catalog:** Automatically populate the shop pages with all registered survival/craftable items from the game and installed mods that have a valid positive value (> 0) in `Upgrader items`.
- Set buy price to `item_value * 1.5` (configurable multiplier in a simple JSON config file) and sell price to `item_value * 1.0`.
- Include Next Page, Previous Page, Search/Sort by price, and Balance display buttons in the bottom row of the chest GUI.
5. Safety: Wrap all reflection calls in `try-catch` blocks so items without a value are safely skipped and the game never crashes.
I need the Upgrader items mod JAR or source, or the class and method that calculate item values. Scanning for any method that accepts an item and returns a number cannot reliably distinguish prices from unrelated values.
There’s also a GUI constraint: this project requires an owo-ui shop, so players would need the mod on their clients; it cannot use the requested vanilla chest-only interface.
Translate ALL user-facing text in this mod into Russian (UTF-8), including GUI titles, item lore/tooltips, button names, chat messages, and add an assets/<modid>/lang/ru_ru.json file. Rebuild the jar.
В проекте пока нет мода или готового JAR, поэтому пересобрать его ещё нельзя. Пришлите JAR или исходный код Upgrader items, чтобы я мог подключить правильный метод расчёта цен и создать магазин с русским интерфейсом.
После создания проекта нажмите Compile в верхней панели, затем Compile в открывшемся окне. На телефоне: ⋮ → Compile Project. После успешной сборки нажмите Download.
No files in this session