Skip to content

Minestom 26.1.2, animation/texture fixes, cleaner API + Blockbench features#73

Open
iam4722202468 wants to merge 6 commits into
masterfrom
feat/minestom-26.1.2-anim-textures
Open

Minestom 26.1.2, animation/texture fixes, cleaner API + Blockbench features#73
iam4722202468 wants to merge 6 commits into
masterfrom
feat/minestom-26.1.2-anim-textures

Conversation

@iam4722202468

Copy link
Copy Markdown
Member

Updates WSEE to the latest Minestom, fixes real animation/texture bugs, cleans up the API, and adds several Blockbench features. Six logically-grouped commits; full build + 12 JUnit tests pass on Java 25.

Bug fixes

  • Animation translation was 4× too weak. The offset was divided by 4 twice (frame provider + display), so position keyframes moved parts a quarter of the authored distance. Verified against a Blockbench-faithful reference renderer (per-bone transforms now match exactly).
  • Only linear interpolation actually worked. catmullrom/step fell into a broken 2-point slerp; translation/scale ignored the mode entirely. Rewritten to real Blockbench step / linear / Catmull-Rom for all channels.
  • Molang keyframes threw on Java 16+. The dev.hollowcube:mql JIT reflectively calls ClassLoader.defineClass, blocked by strong encapsulation → InaccessibleObjectException on the Java 25 target. Replaced with a small dependency-free Molang evaluator (case-insensitive, math.* in degrees, query.*, ternary, etc.).
  • Uppercase/space bone names broke textures on vanilla clients (issue The Textures are not loading for players that do not use the Iris Shader Mod (from Modrinth) #36, masked by Iris/Sodium). Resource-location strings + model filenames are now sanitized/lower-cased.
  • Hardened the base64 texture decode (issue The model cannot display textures #65) and null/missing keyframe fields (malformed models no longer crash the pack build).

Minestom 26.1.2

Version bump + API fixes (getViewers wildcard, sendPacketsToViewers, LazyPacket removal, test-server time API). Also fixed the JUnit runner (was missing junit-platform-launcher, so no tests could run).

Cleaner API

  • ModelEntity — extend it instead of hand-wiring an invisible carrier entity; it owns the model and auto-syncs viewers + position + lifecycle.
  • Normal hit events (breaking): hits on a model hitbox now fire a normal Minestom EntityDamageEvent / PlayerEntityInteractEvent on the owner entity (GenericModel#getOwner). ModelDamageEvent and ModelInteractEvent are removed.
  • setNametag(bone, Component) creates a modern TextDisplay nametag.

New Blockbench features

  • Sound / particle / timeline effects from the animation timeline (default handler + setEffectHandler override).
  • Loop modes — non-looping animations now hold their last frame instead of always looping.
  • Animation blendingplayRepeat(name, blendTicks) crossfades animations by weight.
  • Bone visibilitysetBoneVisible(name, boolean) for damage states / equipment / phases.
  • LocatorsgetLocator(name) returns a locator's world position (previously dropped).
  • Bezier keyframes interpolate as a smooth spline (was a linear fallback); discontinuous keyframes (pre/post values) supported.

Performance

Per-bone metadata dirty-check (only send when a transform changes), live viewer view (no per-tick copy), and per-draw memoization of propagated + world rotation/scale so the hot path stops re-walking the parent chain.

Honest caveats / not done

  • Everything is build- and reference-verified but not yet eyeballed on a live 1.21.11 server — worth a smoke test (animations, textures, effects, the removed-events migration).
  • Left as follow-ups: the world-position single-pass optimization (memoized rotation/scale only), real life_time threading (approximated by anim_time), custom-handle bezier (approximated as Catmull-Rom), and timeline-effect default behavior.

🤖 Generated with Claude Code

iam4722202468 and others added 6 commits July 6, 2026 17:21
- Bump Minestom to 2026.07.01-26.1.2 (from 1.21.11).
- Add the junit-bom + junit-platform-launcher so the test task can actually run
  (it was missing the launcher, so no JUnit tests could execute).
- Remove the dev.hollowcube:mql dependency (replaced by an in-house Molang evaluator).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
The dev.hollowcube:mql JIT reflectively calls ClassLoader.defineClass, which
strong encapsulation blocks on Java 16+, so every Molang keyframe expression
threw InaccessibleObjectException on the Java 25 target (unnoticed only because
the bundled demos use literal keyframes). Molang.java is a small recursive-descent
evaluator (arithmetic, comparisons, && || !, ternary, query./q. namespace,
math.* in degrees; case-insensitive; unknown -> 0; parse errors degrade to 0).
Compiled expressions are cached. MQLEvaluator/MQLData drop the lib annotations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
- Fix a translation bug: the animation offset was divided by 4 twice (frame
  provider + display), so position keyframes moved parts 1/4 as far as authored.
- Rewrite Interpolator to real Blockbench step / linear / Catmull-Rom for all
  channels (was linear-only with a broken 2-point slerp); bezier approximates as
  a smooth spline; support discontinuous keyframes (pre/post data points).
- Play Blockbench sound/particle/timeline effects (AnimationEffect +
  AnimationEffectHandler) with a default handler + setEffectHandler override.
- Respect the loop flag: non-looping animations hold their last frame.
- Animation blending: per-animation weight that ramps; playRepeat(name, blendTicks)
  crossfades in/out; per-bone transforms combine by weight.
- Perf: dirty-check aside, memoize propagated + world rotation/scale per draw so
  the hot path stops re-walking the parent chain; fix a ~20x frame-cache over-alloc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
- Add ModelEntity: extend it instead of hand-wiring an invisible carrier entity.
  It owns the GenericModel and auto-syncs viewers + position + lifecycle, and is
  the hit "owner".
- Replace custom ModelDamageEvent/ModelInteractEvent: hits on a model hitbox now
  surface as NORMAL Minestom EntityDamageEvent / PlayerEntityInteractEvent on the
  owner entity (GenericModel#getOwner). Removes both custom event classes.
- Bone visibility: GenericModel#setBoneVisible / ModelBone#setVisible show/hide a
  bone at runtime.
- Locators: GenericModel#getLocator returns a locator's world position (locators
  are now emitted as position-only bones instead of being dropped).
- Minestom 26.1.2 API fixes (getViewers wildcard, sendPacketsToViewers, LazyPacket
  removal) + per-bone metadata dirty-check to stop re-sending unchanged transforms.
- setNametag(bone, Component) creates a modern TextDisplay nametag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
- Sanitize/lower-case bone names where they become Minecraft ResourceLocations and
  on-disk model filenames, so models with uppercase/space bone names load on vanilla
  clients (issue #36 — was masked by Iris/Sodium).
- Harden TextureGenerator's base64 decode (split at the data-URL comma instead of a
  fixed prefix; warn on non-embedded textures) (issue #65).
- Emit Blockbench locators as cube-less position-only bones so they're queryable.
- Guard null/missing keyframe fields so malformed models don't crash the pack build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
- GemGolemMob/BulbasaurMob use setOwner + normal Minestom hit events instead of the
  removed custom events.
- Main.java: drop the removed setTimeRate call (Minestom 26.1.2 time API change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsZs24bSHE9fCDzFbwyhuH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant