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
+3 -2
View File
@@ -538,8 +538,9 @@ export interface ItemApi {
fluid_capacity(id: Id): number | undefined;
// the tool type it is, like "pickaxe" or "shovel", from the item's "tool"
tool(id: Id): string | undefined;
// what one of it sells for, from the item's "base_sell_value", or undefined if it can't be sold
sell_value(id: Id): number | undefined;
// what one of it sells for with this data, or undefined if it can't be sold: the item's "base_sell_value", and a full
// fluid container's fluid on top, rounded up. see docs/modding/resources/fluids.md
sell_value(id: Id, data?: unknown): number | undefined;
// the components its json lists and their params, a copy. a mod can read params of its components this way
// without a stack, like the curios slots do for bworld:curio_modifiers
components(id: Id): Record<Id, unknown>;
+4
View File
@@ -43,6 +43,8 @@ export interface FluidRules {
name?(data: unknown): string | undefined;
// a color like "#c42d39"
color?(data: unknown): string | undefined;
// what 1000 mB of it is worth when sold, 0 or more and not always whole
sell_value?(data: unknown): number | undefined;
}
// the registries tags are for, see docs/modding/resources/tags.md
@@ -112,6 +114,8 @@ export interface SharedContext {
name(id: Id): string;
// the components its json lists and their params, a copy
components(id: Id): Record<Id, unknown>;
// what one sells for, from its "base_sell_value", or undefined if it can't be sold
sell_value(id: Id): number | undefined;
};
readonly fluids: {
// the rules of one of the mod's fluids, which the server and every client name and color it by