Juice sell price

This commit is contained in:
2026-10-26 19:32:46 -03:00
parent e729b92d20
commit e5221ba681
17 changed files with 182 additions and 47 deletions
+4 -3
View File
@@ -4,7 +4,7 @@
// the box next to the mouse saying what an item is, like minecraft's: its name, the fluid in it, what it's worth, then
// its lore
import { EverythingRegistry, ItemRegistry } from "$/common/everything_registry.ts";
import { contained_fluid, type ItemStack } from "$/common/inventory.ts";
import { contained_fluid, type ItemStack, sell_value } from "$/common/inventory.ts";
import { display_name } from "$/common/utils.ts";
import { fluid_rules } from "$/client/fluid_rules.ts";
import { canvas, draw_text, draw_texture_region, measure_text, type Texture } from "$/client/renderer/mod.ts";
@@ -49,8 +49,9 @@ export function item_tooltip(item: ItemStack): TooltipLine[] {
if (info?.food) {
lines.push({ text: `Restores ${info.food.nutrition} hunger`, color: FOOD_COLOR });
}
if (info?.base_sell_value !== undefined) {
lines.push({ icon: VALUE_ICON, text: `${info.base_sell_value}`, color: VALUE_COLOR });
const value = sell_value(item.type_id, item.data, fluid_rules);
if (value !== undefined) {
lines.push({ icon: VALUE_ICON, text: `${value}`, color: VALUE_COLOR });
}
const static_lore = info?.lore;
for (const lore of [static_lore, item.lore]) {