numismatics: add conversion-crib tooltip to each coin, 0.22.0 -> 0.22.1
Numismatics' x8 uniform chain isn't intuitive. Mod values are hardcoded so we cant fix the ratios, but we can put the conversion table directly on each coins tooltip via KubeJS ItemEvents.tooltip. Players hover any coin -> see how it relates to the others + a hint to use Bank Teller for on-the-fly conversion. ~25 lines, ItemEvents.tooltip hot path is cached per item-id so no performance concern.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// Brass & Sigil — Numismatics coin tooltip helper
|
||||
//
|
||||
// Numismatics' uniform x8 denomination chain (spur=1, bevel=8, cog=64,
|
||||
// crown=512, sun=4096) isn't intuitive at a glance -- people expect
|
||||
// real-world ratios like 1p/10p/20p/50p/£1. Mod values are hardcoded,
|
||||
// so the next-best thing is putting the conversion crib right on each
|
||||
// coin's tooltip.
|
||||
//
|
||||
// Players hover any coin and instantly see how it relates to the other
|
||||
// denominations + a reminder that Bank Teller blocks convert on demand.
|
||||
|
||||
const CRIBS = {
|
||||
'numismatics:spur': [ '= 1 Spur (base unit)', 'Bank Teller block converts.' ],
|
||||
'numismatics:bevel': [ '= 8 Spurs', 'Bank Teller block converts.' ],
|
||||
'numismatics:cog': [ '= 64 Spurs (8 Bevels)', 'Bank Teller block converts.' ],
|
||||
'numismatics:crown': [ '= 512 Spurs (8 Cogs, 64 Bevels)', 'Bank Teller block converts.' ],
|
||||
'numismatics:sun': [ '= 4096 Spurs (8 Crowns)', 'Bank Teller block converts.' ],
|
||||
};
|
||||
|
||||
ItemEvents.tooltip(event => {
|
||||
for (const id in CRIBS) {
|
||||
event.add(id, CRIBS[id].map(line => Text.aqua(line)));
|
||||
}
|
||||
});
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "Brass-and-Sigil pack.lock.json - generated, do not edit by hand unless you know what you are doing",
|
||||
"name": "Brass and Sigil",
|
||||
"version": "0.22.0",
|
||||
"version": "0.22.1",
|
||||
"minecraft": "1.21.1",
|
||||
"loader": {
|
||||
"type": "neoforge",
|
||||
|
||||
Reference in New Issue
Block a user