promotional bannermobile promotional banner

Ziggfreed's CommonLib

Common Library for Ziggfreed's Mods
Back to Files

ZiggfreedCommon-1.2.0.jar

File nameZiggfreedCommon-1.2.0.jar
Uploader
ziggfreedziggfreed
Uploaded
Jul 7, 2026
Downloads
1.5K
Size
468.9 KB
File ID
8384768
Type
R
Release
Supported game versions
  • 0.5

What's new

A difficulty-scaling engine primitive, two ref-less spawn-hook helpers, and a dialogue-engine authoring pass (native inheritance + data-driven option styling + reusable option fragments), all additive over 1.1.1. Nothing here is breaking; consumers pick up only what they call.

Dialogue engine

  • Changed: dialogue reuse is now NATIVE Parent inheritance, not a hand-rolled template DSL. A body carries a top-level "Parent": "<id>" resolved through the engine's own inheritance (a new InheritMapCodec merges the Nodes map BY KEY, node fields inherit-on-omit); the old extends/params/nodeOverrides/extraNodes/prune resolver is gone. State-varied beats collapse onto per-node runtime Conditions plus new AllOf/AnyOf/Not combinators and a QuestState-style States OR-shorthand, and a node can self-gate with its own Conditions.

  • New: per-option Presentation + fully data-driven default styling. An option can carry a Presentation ({Color, Icon:{Item,Glyph}}) that overrides its look, and the per-kind DEFAULTS (accept / turn-in / continue / neutral / farewell colours + glyphs) now live in a pack-authorable DialogueOptionTheme asset (Server/ZiggfreedCommon/DialogueOptionTheme/*.json, folded defaults < pack < owner) instead of Java literals. A server owner or content pack retints every dialogue option by dropping a same-id file, no code; the built-in enum is only the fail-closed fallback. (Glyph textures still live in the row .ui - a Java-set texture path renders a red X - so the theme drives the colour and which glyph shows.)

  • New: an option Style field. An option declares its themed look by kind ("Style": "accept"), overriding the action-derived style and resolving through the DialogueOptionTheme - a theme-driven, one-edit-changes-everywhere alternative to hard-coding a per-option colour/glyph.

  • New: shared option fragments (Fragments + IncludeOptions). A dialogue declares a "Fragments": { "<id>": [ ...options ] } map and a node pulls a fragment in with "IncludeOptions": ["<id>"]; the resolver appends the fragment's options to the node before decode. A shared footer (a common set of menu / navigation options) is authored ONCE and referenced by every node instead of copy-pasted. A no-op for any dialogue that uses neither.

  • New: scaling/ - a generic, domain-free difficulty-scaling engine. ScalingContext (a base difficulty + a double[] of participant powers + an aggregation mode + an opaque instance handle) is the ONE input abstraction serving both open-world proximity groups and 1-10 player instances, with zero player / party / skill types leaking into the library. AggregationMode (SOLO / AVERAGE / PEAK / WEIGHTED / DISABLED) plus PowerAggregation.fold combine the array into one effective power; ScalingEngine.resolve(ctx, bandWidth, minCap, maxCap) clamps a band-limited power delta over the authored floor. Pure logic, zero engine coupling, unit-tested. A consumer builds the context (open-world: a cached region power scalar; instanced: a party reduced to a double[]) and calls the SAME engine for both.

  • New: HealthUtil.scaleMaxHealth(Holder, factor, key). The ref-less overload of the existing HP-scaler: raise a mob's Health MAX and heal to it reading the stat map straight off a pre-add Holder, so a mob can be scaled INSIDE an onEntityAdd spawn hook before it has a valid ref. Idempotent per holder, world-thread, fully try-guarded.

  • New: EntityIdentifierUtil.roleName / roleIndex. Read an NPC's role identity from its NPCEntity component: roleName (the restart-stable string to key config on) and roleIndex (the restart-unstable integer for hot in-tick lookups only). Both offer a Store/Ref form and a ref-less Holder form for a pre-add spawn hook.

This mod has no related projects