last_one_core-1.5.0
Curse Maven Snippet
What's new
1.5.0
Fix a Confluence accessory losing its whole "while worn" attribute block on a dedicated-server client. TerraCurio stores an accessory's inherent attributes in PortLib's
terra_curio:accessoriesdata map and only falls back to the attributes baked into the item instance, which is empty for every accessory defined in data; single player hands that map straight to the client, while a dedicated server depends on PortLib's login negotiation to deliver it. Measured on a real dedicated-connection client, that map is empty (PortDataMapLoadersize 0,holder.getDatanull) forwarrior_emblem,fire_gauntletand every other data-defined curio, while items whose attributes are defined in code (band_of_mediumship,soulcerer_emblem) still report them - which is why only part of the accessories lost the block, why prefix attributes kept showing (Curios merges those separately), and why the attributes still apply on the server. PortLib skips the sync entirely whenPortKnownRegistryDataMapsReplyPayloadnever filledATTRIBUTE_KNOWN_DATA_MAPS, soonDatapackSyncpublishes the server's own data map as an item-to-modifier table on a dedicated channel; the client caches it and aBaseCurioItem#getAttributeModifiersinjection supplies it only when the item reports no attributes at all, so single player and any client whose data map did arrive are untouched and nothing is invented client-side. Toggle:accessoryAttributeSync.enabled(default on) - turn it off once PortLib fixes the upstream sync.Keep the tooltip diagnostics but stop wiring them up.
TooltipDiagnostics,CuriosTooltipProbeand the two*TooltipProbeMixinclasses only existed to pin the failure above to a layer, and they log a line per hovered curio; their registration inPrefixDefinitionSyncis now commented out and the two probe mixins are out of the mixin config, so nothing of them runs. The sources stay on disk - re-enabling them is uncommenting one line and putting the two mixins back in the client list.Fix configured prefixes never being applic-able on a dedicated server while the same pack reforges fine in single player: a client refused the click locally because it could not resolve the prefix id the menu carried. The menu's synced preview id is produced by
NPCReforgeMenu#slotsChangedindependently on each side and is never transmitted, and at least one mod in a real pack relays such menu data as a signed short - observed values11292,-6578,-4015,18878are exactly1275210780,1278600782,1291513937,1289832894(configured ids) truncated to 16 bits.ModPrefix.ID_MAP.get(truncatedId)then returns null,clickMenuButtonreturns false without sending anything, and no server-side line can explain it. Configured menu ids are now allocated from 1000..30999 (deterministic hash of the key plus forward probing with a coprime stride) instead of0x4C000000 | hash, so a 16-bit truncation becomes a no-op; native Confluence ids (1..97) were never affected, which is why only custom items broke and why single player (one instance, no menu transport) worked. The id allocation is still a pure function of the prefix key, so both sides agree without exchanging anything, and older ids are not persisted anywhere (PrefixComponentstores the prefix by name). The server additionally publishes the preview id it computed (PrefixId/prefix_definitionspayload 2), so a client shows and gates on the id the server will actually apply.Fix configured reforges being blocked on the client while the server considered them valid, and make the definition sync publish the actual Confluence menu ids. The prefix entries in
prefixes.jsoncarry no numeric id, so every configured prefix gets its Confluence menu id at registration time fromPrefixDefinitionRegistry(a hash of its key, masked and combined with the id base), and entries are individually withdrawn when their key matches a Confluence prefix name or the id is already taken - a decision that reads this instance'sModPrefix.ID_MAP. Two instances of the same file could therefore end up with different id sets: the server wrote an id the client had never registered into the reforge menu's synced data, the client'sNPCReforgeScreen#canReforge()gate resolved nothing, and the click sent no packet - which is exactly the "single player works, server does not" shape, since single player is one instance whose ids always agree with themselves.PrefixDefinitionRegistrynow records the ids it registered (getResolvedMenuIds,getResolvedIdsDigest), the sync payload wraps the definition file together with that map plus both digests, and a client registers the prefixes at the ids it was sent instead of deriving its own. The client no longer skips the swap just because the file digest matches - matching files do not imply matching ids - and it only skips when its id map already equals the published one. The sync channel protocol went from1to2: a client on an older build simply keeps its own ids (the new gate diagnostic reports the unresolved id together with this side's rule/prefix counts, definition source, applied digest and id digest) instead of mis-parsing the payload, so update both sides together.Fix configured accessory prefixes not stacking.
PrefixDefinitionRegistryderived one attribute modifier UUID per(prefix key, attribute, modifier index)while parsingprefixes.json, andConfiguredPrefixshared that singleAttributeModifiersValuewith every stack carrying the prefix, so two accessories with the same prefix wrote the same UUID into the player's attribute map, which is indexed by UUID, and only one of them applied. This is the accessory counterpart of the armor fix in 1.4.6; the accessory path could not be fixed per slot because Confluence adds those modifiers throughPortItemAttributeModifierEventunder theMAINHANDslot group, which cannot tellring #0fromring #1(Terra Curio'sBaseCurioItemalso ignores theSlotContextand slot UUID that Curios hands it).ConfiguredPrefixnow re-keys the parsed template modifiers with a per-component salt atcreateComponenttime, mirroring how Confluence's ownModPrefix#createModifierappendsLibUtils.withUniqueSuffix, so every stack carries its own identities. The re-keyed UUIDs are stored inside the prefix component written to the stack, so equipping and unequipping stay consistent, and thelast_one_core.prefix.modifier name is kept for the intrinsic-replacement guard. Items created before this change keep their old shared identities until they are reforged.Make the dedicated server authoritative for
config/last_one_core/prefixes.json. That file was read separately on every machine, yet it decides both whether an item may be reforged (PrefixSupportRules.canReforgeConfiguredItem→PrefixDefinitionRegistry.hasConfiguredPrefixes) and which ids configured prefixes occupy in Confluence'sModPrefix.ID_MAP, whichNPCReforgeMenuuses to synchronize the rolled prefix. A server without the edited copy therefore fell back to Confluence's native tag-only eligibility, so items that only became reforgable through configured selectors (items,namespaces, thearmorcategory onforge:armors, a customaccessorycategory) worked in single player and failed on the server, and a client whose copy differed could not resolve the prefix ids the server sent. On join, the server now sends its own file in gzip-compressed parts; the client parses it instead of using its local copy, restores its local definitions when it leaves the server, and each side reports the SHA-256 of its file, so an out-of-date copy shows up in the server log instead of as a silent behaviour difference. Toggle:prefixSupport.serverAuthoritativeDefinitions(default on, honored on both sides - a client with it disabled keeps its own copy and logs the difference);prefixSupport.saveServerDefinitionsLocally(default off) additionally writes the server's copy into the client's config file. The load log line and the sync log now carry the file digest. The server's own file is still what matters for gameplay, and it is still only read at startup, so a changed file needs a server restart.Make the best-prefix pause work for configured equipment. Confluence pauses the Goblin Tinkerer for
BEST_PREFIX_PAUSE_TICKSafter a "best" roll, and its check compares the rolled prefix by reference against native prefix singletons (prefix == Universal.GODLY, and forACCESSORYa fixed list of seven native instances). A configured prefix fromprefixes.jsonis this mod's own object, so that test could never match and custom equipment never paused.PrefixType#isBestPrefixis now taken over for items that use a configured pool, where "best" means the roll sits on the highest tier of the pools applying to that item - the same rule thebestroll already uses, so pause and roll agree. With the shipped defaults this reproduces Confluence's shape: one top-tier entry for melee/ranged/magic/tacz/summon, three for armor, five for accessories.Stop letting one unusable prefix entry disable the whole takeover layer. A prefix whose key clashes with a Confluence prefix name or with another menu ID used to abort registration, and the outer handler then cleared every rule and pool, so one typo in
prefixes.jsonmeant that no configured item could be reforged anywhere while the log kept a single stack trace. Such entries are now rejected individually with a warning that names the prefix and the reason, are removed from the pools that referenced them, and an equipment rule that loses every prefix is dropped on its own with a warning. Structural problems in the file (bad version, missingpools/equipmentTypes) still fall back to Confluence's native selection as before.Add reforge diagnostics, because Confluence refuses a reforge silently: when
PrefixUtils.couldReforgeis false the server writesUNKNOWN/-1/0x3F3F3F3Finto the synced menu data, the client'scanReforge()gate then fails, and clicking the tinkerer sends no packet at all.[debug] reforgeDiagnostics(default on) logs the decision chain once per item type at the moment the menu refuses an item -prefixSupport.enabled, whether the takeover applies to that item, Confluence's own prefix type versus the configured one, which equipment rules matched with their pools and prefix counts, whether the item sits inconfluence:unable_to_apply_prefix, how many rules and prefixes this side actually loaded, and the digest of the definition set in use (local file or server-published). Two read-only commands expose the same data on demand:/lastone reforge-checkfor the held item and/lastone statusfor the loaded counts, digest and toggle states. Player commands are executed by the server, so they cannot show the client's half of the decision, and the gate that suppresses the click (NPCReforgeScreen#canReforge) runs on the client: when a click there is swallowed, the failing condition now appears in the action bar and is logged once on the client - client-sidecouldReforgefailing (the client's ownprefixes.jsonorprefixSupport.enabled), an unresolvable preview prefix id (the two copies differ), the cost sentinel, a missing price/money balance, or the best-prefix pause still counting down. The two hooks that touch newer Confluence members (PrefixType#isBestPrefix, thenpc_screenreforge screen) are declaredrequire = 0, because the Confluence release pinned for compilation predates them; they apply on builds that have them and skip cleanly otherwise.
This mod has no additional files