Skip to content

Superman#59

Draft
duzos wants to merge 13 commits intomasterfrom
feat/superman
Draft

Superman#59
duzos wants to merge 13 commits intomasterfrom
feat/superman

Conversation

@duzos
Copy link
Copy Markdown
Member

@duzos duzos commented Jul 8, 2025

About the PR

Why / Balance

Technical details

Media

Requirements

Breaking changes

Changelog

@duzos duzos changed the title Supermna Superman Jul 8, 2025
@github-actions github-actions Bot added S: Untriaged C: Textures Changes: Might require knowledge of spriting or visual design. and removed S: Untriaged labels Jul 8, 2025
duzos and others added 7 commits July 8, 2025 23:44
# Conflicts:
#	src/main/java/mc/duzo/timeless/suit/set/SetRegistry.java
extends superman's powerlist beyond the placeholder flight + super_strength + swift_sneak. now reflects superman's iconic feel:

- new invulnerability power: resistance iii tick (22-tick duration refreshed every second), same pattern as super_strength
- super_jump added (already existed in powerregistry, was unused on suits)

heat vision / cold breath / x-ray are intentionally out of scope - those need bespoke logic (raycast / projectile / damage tuning) and deserve their own pr each.
@duzos duzos added the enhancement New feature or request label May 2, 2026
@duzos
Copy link
Copy Markdown
Member Author

duzos commented May 2, 2026

Picked this up to add some iconic Superman powers beyond the placeholder kit:

  • New INVULNERABILITY power (Resistance III tick on a 1s cycle, same pattern as SUPER_STRENGTH) -- now in PowerRegistry.
  • Added SUPER_JUMP (already in registry, was unused on any suit) and INVULNERABILITY to GenericSupermanSuit's PowerList.

Also merged current master in (commit 907b2fb) to bring the suit-data attachment, FabricPacket keybind, and perf fixes onto this branch -- it was sitting on a stale base.

Heat vision / cold breath / x-ray are intentionally not in this push -- each needs bespoke logic (raycast / projectile / damage tuning) and deserves its own PR. Happy to scope those if wanted.

double-tap activation:
- new client/keybind/doubletapjumpflight detects two jump-key presses inside a 250ms window while on the ground.
- on activation it resolves the player's current suit, finds the index of powerregistry.flight in the powerlist, and sends a usepowerc2spacket. flightpower toggles flightenabled, same backend as iron man's z key, just a different trigger.
- ground-only gate avoids accidentally deactivating mid-flight (vertical ascent already uses repeated spacebar).

datagen build pipeline:
- configuredatageneration { modid = "timeless" } - without the modid filter, the animator mod's datageneratorentrypoint also fires during runDatagen and removes our generated files as "stale" since they aren't in its expected output set. only superman items hit this because they were the latest additions to the registry not yet in the cache.
- sourceSets.main.resources.srcdirs += "src/main/generated" - loom 1.7's auto-include isn't firing here. explicit add lets processresources see datagen output.
- processresources excludes .cache/** and uses duplicatesstrategy.include to handle the datagen pipeline's intermediate files cleanly.
@duzos
Copy link
Copy Markdown
Member Author

duzos commented May 2, 2026

Two more changes pushed (5dbda02):

Superman flight on double-tap spacebar (client/keybind/DoubleTapJumpFlight.java)

  • Detects two jump-key presses inside a 250ms window, while on ground.
  • Resolves the wearer's suit, finds the PowerRegistry.FLIGHT index in its PowerList, sends a UsePowerC2SPacket. Same backend as Iron Man's Z, just a different trigger.
  • Ground-only gate so vertical ascent (which uses repeated spacebar already) doesn't accidentally toggle flight off mid-air.
  • Generic on PowerRegistry.FLIGHT membership, so any future flight-capable suit gets this for free; not Superman-specific in the code, but Superman is the obvious primary user.

Datagen pipeline fix (build.gradle)

  • configureDataGeneration { modId = "timeless" } - without the modid filter, Animator's DataGeneratorEntrypoint also fires during runDatagen and removes our just-generated files as "stale" because they aren't in its expected output set. This explains why the runtime warned about Superman items specifically: they were the newest additions to the registry, not yet present in the leftover cache.
  • Explicit sourceSets.main.resources.srcDirs += "src/main/generated" plus a .cache/** exclude on processResources (loom 1.7's auto-include isn't firing here).
  • After this, ./gradlew clean runDatagen processResources reliably produces all four superman_generic_*.json model files in build/resources/main.

The four Superman item icons will still render as the missing-texture purple/black checker until textures/item/superman_generic_{helmet,chestplate,leggings,boots}.png exist - that's artist work, out of scope here.

Run-client smoke test:

  • Equip the full Superman suit set.
  • Double-tap space on the ground -> player starts flying (FlightPower behavior, same as iron man).
  • Z key still works as a toggle path.

duzos added 4 commits May 2, 2026 21:01
two issues from in-game test:

1. doubletapjumpflight required isOnGround for both presses, but pressing space on the ground jumps the player off the ground, so the second press always lands airborne -> code reset and never fired. dropped the gate. now also only activates (skip if hasFlight is already true) so mid-flight accidental double-tap will not drop the player out of the sky; z-key toggle still handles deactivation. flight search loosened to any flightpower subclass so boosted_flight is also matched.

2. superman was using plain flight (mk2/mk3 style) but the user wanted iron-man flight which is boosted_flight (mk5/mk7) - sprint while flying for the boost path. switched superman to boosted_flight.

window also bumped from 250ms to 300ms which is closer to standard double-click timing.
three issues, three targeted fixes:

1. real arms not matching suit translations: suitfeature called copyfrom (biped -> suit) before setangles but never copied the post-animation state back. now also calls copyto (suit -> biped) after setangles, so the player biped follows the suit's animated/rotated bones (flying tilt etc.).

2. suit not always rendering: supermansuit overrode isalwaysvisible to false, so the suit disappeared whenever the player was invisible. removed the override - default in suit.java is true, which is what we want.

3. first-person showed only the suit, no hand / no held item: the renderArm mixin was @at("HEAD") cancellable with ci.cancel(), so vanilla's player arm + sleeve + the path that lets held items reach the wrist were both stomped. switched to @at("TAIL") - vanilla draws the arm and the held-item rendering happens normally, then the suit arm is layered on top.
base cuboids on stevesuitmodel and alexsuitmodel had dilation 0.0 - same dimensions as the player skin underneath - so the suit z-fought with the body wherever they overlap (whole torso, arms, legs).

bumped base layer to dilation 0.25 (suit always slightly outside the player skin) and overlay layer to 0.5 (always slightly outside the new base) so the layering is body < suit-base < suit-overlay with clear depth separation. matches the convention vanilla uses for armor models.

bonus: revert from previous commit was that supermansuit's isalwaysvisible removal still applies; that was a separate visibility-during-invisibility issue, not the z-fight one.
rotateParts (the procedural flight tilt + roll on body/limbs) was being called inside each suit model's render() method. but suitfeature already does:

  copyfrom(biped)  -> suit takes biped pose
  setangles(...)   -> suit runs animations
  copyto(biped)    -> player biped takes suit pose
  model.render()   -> rotateparts ran here, too late

so the tilt landed on the suit only. the player's actual biped (which the suit visually overlays) kept its un-tilted pose, leaving a visible mismatch in flight.

centralized the timing: suitmodel.setangles now calls a protected rotateparts hook (default no-op) right after runanimations, gated on the same anim/transform condition the subclasses used. moved the actual implementations from private to @OverRide protected in stevesuitmodel, alexsuitmodel, genericironmanmodel, markfivemodel and removed the rotateparts call from each render(). the per-model translates/scales that lived alongside rotateparts in render() stay where they were (those are render-only matrix ops, not part-state mutations).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: Textures Changes: Might require knowledge of spriting or visual design. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants