Extends the generator from dialogs and factions to most of what a CustomNPC+
world holds: 146 files where there were 70.
Quests walk every axis -- all six types, all eight repeat modes, both completion
modes, the nine reward slots, the party and profile blocks in both their written
and their omitted form, and each objective kind in depth. Worth recording that a
quest has no availability at all: Quest.readNBTPartial calls
VersionCompatibility.CheckAvailabilityCompatibility, whose name says otherwise,
but that is a generic fill-in-missing-keys pass applied to every ICompatibilty.
Quest declares no Availability field, writeToNBTPartial emits no Availability*
key, and neither does the 1.20 line. Gating belongs to the dialog that offers the
quest.
Custom effects turned out to persist in two places: customeffects.dat is only an
index of {Name, ID}, and each effect is a file under customeffects/ whose
FILENAME is its name -- loadEffectsFromDir overwrites the name key after reading,
so the two can disagree and the file wins. There is a fixture for that, one for
an effect with no name at all (absent from the index, and its file is ".json"),
and one whose script crosses 65535 chars so ScriptContainer splits it across
Script plus ExpandedScript0..N. It splits into two parts; the fixture records
that rather than predicting it.
Player records exercise all fifteen sub-writers, including a quest whose
ExtraData holds the per-objective counters -- the quest itself stores only its
targets, so progress lives nowhere else. Written in both containers, since
ConfigMain.DatFormat picks between JSON and gzipped NBT and a server will have
either. PlayerData.getNBT ends at DBCAddon.instance.writeToNBT, so boot now
constructs the shell addon; without the companion mod every method is a no-op,
which is the state a real server is in.
Also global, tags, transport, banks and spawns. Two shapes there are easy to
miss: a spawn entry numbers its variants as SpawnCompound0..N keys rather than a
list, so they must be probed for; and transport stores a bare int dimension
beside a position, including a modded 7265, which is the signature that stopped
being expressible after 1.16.
Tag.uuid defaults to randomUUID(), so every tag fixture pins one. Two full runs
still diff clean across all 146 files.
Scribe needs fixtures to test its readers against, and the only fixtures worth
having are ones CustomNPC+ wrote. A hand-authored factions.dat asserts what its
author believed the format to be, so a reader checked against it proves only
that the two agree.
So this drives the shipping data classes' own writeToNBT/writeNBT against a
bootstrapped-but-unlaunched Minecraft. What is copied rather than executed is
only the layout -- which file, under which directory -- because the controllers
reach that through getWorldSaveDirectory(), which returns null with no server,
and every save* fires SyncController into a network stack that is not there.
Each method names the controller it was copied from.
Two obstacles, both worth recording.
Item stacks needed the registry, and populating it goes through Forge:
FMLControlledNamespacedRegistry -> GameData.addPrefix, which asks
Loader.instance() for the active mod's namespace, and constructing a Loader
casts its classloader to LaunchWrapper's. Rather than reimplement the naming
rule, the singleton is filled with an unconstructed Loader so activeModContainer
returns null and addPrefix takes its own "no mod container, assume minecraft"
branch -- the branch real vanilla registration takes anyway. Verified against
minecraft:diamond as it appears in the worlds under run/saves, so the shortcut
is measured rather than assumed.
Second, nothing was reproducible: PlayerMail.writeNBT stamps TimePast from the
wall clock, and a PlayerMail hangs off every dialog and quest whether or not
mail was configured, so all 67 files differed between runs. Pinned to zero,
which is the only key here rewritten after CustomNPC+ produced it, and the count
is printed every run so it cannot spread quietly. Two runs now diff clean.
Branched from 8612d444 rather than dev, because dev's tip does not compile --
1.11.2-beta1 calls PlayerData.flushEffects() and save(boolean), neither of which
exists -- and because that commit is the baseline Scribe pins as specification.
70 files across four worlds: maximal walks every enum and flag, defaults is what
a fresh world gets, edge is legal content readers get wrong, and legacy ages
documents by removing keys to exercise the upgrade path. Dialogs and factions
so far; the remaining systems follow.
ScriptEntity.hashCode included tempData while equals compares only the entity,
so two wrappers of the same entity hashed differently - and tempData is mutable
and swapped wholesale by copyTempData, so an entry's hash could change while it
sat in a map.
BlockCampfire.onBlockActivated went from returning true to false, which lets the
held item be used or placed on top of the interaction. Restored.
Revision 23 never shipped without the burn flag - it released together with it -
so no saved NPC carries version 23 from a build that lacked pBurnItem. The
migration belongs in the < 23 gate, and bumping ModRev would only force a
redundant pass over every NPC.
Deferring registration to loadComplete is right - TConstruct needs to have
registered first - but naming TabRegistry and the tab classes in CustomNpcs put
client-only GUI types in a class the server loads, which the verifier resolves
at link time regardless of any runtime side check. A proxy hook keeps them in
ClientProxy while still running at the same point.
The free-ID search only consulted the global map, so it could pick an id the
same category still held further down the iteration - and renameTo silently
overwrites on POSIX, so the rename then destroyed that entry's file. It now
skips ids held by the category and any file already on disk.
Quests had the same discard-on-collision behaviour and now get the same
reassignment, including re-registering shared quests under the new id.
The migration sat in the npcVersion < 17 block, but ModRev has been 23 since
2023 and CheckNpcCompatibility returns early when the save already matches it -
so every NPC affected by the regression was skipped. Moved to a < 24 block and
bumped ModRev to 24 so it actually reaches them.
Mouse.getDWheel() clears the accumulated delta, so whichever widget polled it
first in a frame took it and every later reader saw zero. The script text areas
polled it themselves, after the parent screen had already drained it for its
scroll lists, so the wheel did nothing in the player, NPC and event script GUIs.
The screen now reads the wheel once per frame into the mouseScroll field it
already declared for this, and each widget zeroes it when it consumes it.
start() and tick() compared against the raw windUpTicks, but when the windup is
synced to an animation the value that applies comes from getWindUpTicks(). An
ability configured that way skipped its windup entirely and fired on the first
tick. The telegraph duration used the raw field too, so it disagreed with the
phase it was meant to cover.
Same leak as the ability magic editor: @SideOnly strips the annotated method on a
server but not the synthetic lambdas it generates, so ConditionHasEffect,
ConditionQuestCompleted, AbilityTrap and AbilityZone all shipped methods whose
descriptors named a client-only GUI class. Each field is now built in the GUI
class it belongs to.
EntityAITransform claimed the PASSIVE mutex, so any running movement or look
task blocked it from ever starting. The swap only happened in the gaps where
those yielded - which is why it appeared to trigger when an NPC said a line and
for a moment afterwards. The task only polls world time and flips the state, so
it needs no mutex at all.
The magic editor field was built with lambdas inside Ability.getAllDefinitions.
subGuiField is generic, so those lambdas took SubGuiAbilityMagic as their
descriptor type. @SideOnly strips the annotated method on a server but not the
synthetic lambdas it generates, so anything reflecting over Ability's declared
methods - Nashorn's adapter generator when a script touches an ability - hit
NoClassDefFoundError. Building the field in the client class keeps the type out
of Ability entirely.
Charge drives the NPC with applyVelocityFlat but never declared that it does, so
locking movement during the active phase zeroed its motion outright while not
locking left the navigator running against it - no setting worked. It now
declares its own movement and locks both phases, so the navigator stays clear.
The value is configured, stored and labelled as damage per second, but a pulse
applied it whole, so the real rate was damage per interval - it only matched at
the default interval of 20. A pulse now deals the share of a second it covers.
The interval is floored at 5 ticks, which also bounds how often a zone scans;
this replaces the per-tick membership check, which cost 20x the entity queries.
Barriers are plain entities, so no LivingHurtEvent fires for them and nothing
scaled an incoming melee hit - vanilla handed over the bare attackDamage
attribute and a dome took one point per swing however strong the attacker was.
Attributes now apply, and modifyBarrierMeleeDamage gives addons the same seam
they already have for barrier health.
- Hazards only checked who was inside once per damage interval, so the boundary
where damage started and stopped drifted by however far an entity moved in
between - several blocks at sprint speed. Membership is now checked every
tick and damage accrues per entity from the time it actually spends inside.
- Barriers counted elapsed ticks instead of holding a deadline, so every tick
the entity missed extended it past its configured duration. They now expire
on an absolute world time like the other energy entities.
- Anchored lasers re-derived their direction straight at the target every tick,
discarding the rate-limited look vector, so track speed did nothing and the
beam was undodgeable. They now converge on the point the owner is aiming at.
- Rotation-locked NPCs aimed energy projectiles and hit-scan projectiles from
the target''s position, so the lock was purely visual. Both now respect the
frozen heading.
heightFactor did not fully cancel ModelTail''s anchor, leaving both the wrapped
and plain monkey tails two pixels below where JBRA renders them on players.
The terminal DAZED to IDLE transition was swallowed before the completion
switch ran, so the finished ability stayed set as the current one and the NPC
never started another until it died and reset. Guard abilities compounded it:
NPCs reuse a single ability instance and onExecute left pendingCompletion set,
ending every later activation on its first tick.
An NPC rolled both clocks and folded the ability''s cooldown into the global one
as well, so the global timer always outlasted the per-ability entry and the
setting could never reject anything. The global timer now only paces the NPC
when the ability tracks its own cooldown.
Dimension change and teleport were already fixed, but disconnect still cleared
cooldowns and login cleared them again, and they were never written to NBT - so
relogging reset every cooldown. They are absolute world-time deadlines, so they
now persist and are restored on load.
Deleting a custom ability only cleared the unlocked list. An active toggle kept
a direct reference and went on ticking, stale hotbar slots survived, and the
client was never resynced so it still showed and could select the ability.
Selecting a key the player no longer has now deselects instead of firing
whatever was previously selected.