Commit Graph

10 Commits

Author SHA1 Message Date
tkrmagid
e6faae3f39 v0.4.5: panel-center audio, preload chat feedback, defensive BE check
Some checks failed
build / build (push) Has been cancelled
- audio: distance attenuation now uses the panel center (width/2, height/2
  offset from the anchor along the renderer's right/up axes) instead of the
  anchor block corner, so a 4x4 panel sounds like it's coming from the
  middle of the screen and not the bottom-left.
- preload: each client now posts a chat line on start / completion / failure
  / cache-hit, so a command-block sequence like /videopreload -> /videoplace
  can be timed against the visible "[videopreload] 완료" message.
- safety: VideoPlayback.tick() verifies the anchor BE still exists at each
  active position and forcibly stops playback if it doesn't — covers any
  edge case where BLOCK_ENTITY_UNLOAD doesn't fire.
- /videopreload feedback now explicitly states "완료 알림 후 재생하세요".
2026-05-15 21:53:21 +09:00
tkrmagid
4fc7cf46b7 v0.4.4: fix audio-on-delete, reduce stutter, add /videopreload
Some checks failed
build / build (push) Has been cancelled
- fix: stop playback when anchor block entity unloads (BLOCK_ENTITY_UNLOAD)
  so deleting a video while audio is playing actually silences it.
- fix: force-stop SourceDataLine and grabber from outside the worker thread
  so a blocked line.write() / grab() unblocks immediately on close.
- perf: tune FFmpeg streaming options (buffer_size, probesize, analyzeduration,
  max_delay, fflags=+genpts, reconnect_delay_max) and pre-size audio line buffer
  to ~0.5s to smooth out mid-stream stutter.
- feat: /videopreload <url> broadcasts a S2C PreloadPayload to all clients;
  each client downloads the URL to <gameDir>/video_player_cache/<sha256> and
  subsequent playback reads from the local file instead of streaming.
  Gated by COMMANDS_GAMEMASTER (op level 2), so command blocks can invoke it.
2026-05-15 21:42:11 +09:00
tkrmagid
0d1f802555 docs: add missing javacpp native jar to install guide (v0.4.3)
Some checks failed
build / build (push) Has been cancelled
JavaCPP Loader (javacpp.jar) ships pure-Java code that needs its own
JNI bridge DLL (jnijavacpp) to extract & link other native libraries.
That bridge lives in the platform-specific javacpp-<os>-<arch>.jar
which the old install guide silently omitted — users following it
ended up with a black panel and an UnsatisfiedLinkError for jnijavacpp
because FFmpeg natives could never be loaded.

This bumps the required JavaCV jar list from 4 to 5, updates the
-Xbootclasspath/a: examples on all three OSes, and adds a diagnostic
note for the matching log line.

Docs-only change; mod code is unchanged from v0.4.2.
2026-05-15 21:22:02 +09:00
tkrmagid
4b14fb479b fix(item): namespace item/generated parent for 26.1.2 model loader (v0.4.2)
Some checks failed
build / build (push) Has been cancelled
The held video_stick item rendered as the default missing-model cube even
with v0.4.1 jar loaded (lang strings resolved, so the mod itself was active).
Root cause confirmed against Fabric 26.1.2 docs: the new model loader no
longer auto-resolves unprefixed parent paths. `item/generated` needs to be
written as `minecraft:item/generated`.

models/item/video_stick.json — parent → minecraft:item/generated.
gradle.properties — 0.4.1 → 0.4.2.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 21:02:03 +09:00
tkrmagid
459b3249a4 fix(render): anchor video to clicked block's bottom-left, EAST/WEST flush
Some checks failed
build / build (push) Has been cancelled
Three fixes for v0.4.1:

1. Video stick item rendered as missing-texture because 26.1.2 requires the
   new client_item descriptor at assets/<mod>/items/<name>.json. Add it; the
   existing models/item/video_stick.json is kept as the underlying model.

2. Quad placement now anchors the local (0,0) corner at the bottom-left of
   the wall face the player clicked, so the clicked block is the BL and the
   video grows up & right. Previously it was centered on the anchor.

3. EAST/WEST face rotations were swapped, which placed the quad on the far
   side of the air block (~1 block away from the wall) instead of flush.
   Derived the correct rotations from first principles:
     EAST = Axis.YP +90°  (local +Z → world +X, +X → -Z = north)
     WEST = Axis.YP -90°  (local +Z → world -X, +X → +Z = south)
   NORTH/SOUTH/UP/DOWN math re-verified — those were already correct.
2026-05-15 20:21:19 +09:00
tkrmagid
2b50f56980 render: paint video on the clicked wall face (no visible anchor block)
Some checks failed
build / build (push) Has been cancelled
The anchor block becomes invisible and non-collidable; it exists only as a
BlockEntity host in the air block adjacent to the clicked wall. The renderer
now translates and rotates the textured quad so it sits flush against the
surface of the wall the user actually clicked, on any of the six faces.

Stick interaction:
  right-click face → place anchor at hit.relative(face), facing=face, open GUI
  right-click face with anchor already there → reopen the GUI
  sneak + left-click face with stick → delete the anchor on that face
The anchor's selection outline / collision / occlusion are all empty, so the
player can target the wall block behind it without interference.

JavaCV / streaming polish:
- Bump missing-JavaCV log to WARN so users notice when the runtime jar is
  not installed (previously buried at INFO).
- Add HTTP resilience options: `timeout`, `reconnect`, `reconnect_streamed`,
  `reconnect_at_eof`, and a `user_agent` so picky servers don't 403 us.
2026-05-15 20:08:33 +09:00
tkrmagid
429244d820 audio: route JavaCV samples through SourceDataLine with live gain
Some checks failed
build / build (push) Has been cancelled
setVolume/Mute previously stored gain without affecting audible output: the
backend only called grabImage() and never opened an audio sink. Switch to
grab() (interleaved video+audio frames), force AV_SAMPLE_FMT_S16 on the
grabber so samples are always interleaved signed 16-bit PCM, open a matching
JavaSound SourceDataLine and write scaled samples per-frame. gain is read
on every block so /videoMute, GUI Mute and the per-tick distance attenuation
now take effect immediately. SourceDataLine.write blocking provides natural
A/V pacing, so the legacy 15ms sleep is dropped when an audio line is open;
sleep is retained as a 60fps cap when there is no audio device.

bump version to 0.3.1.
2026-05-15 19:45:42 +09:00
tkrmagid
8f69814cb2 build: switch toolchain to MC 26.1.2 (intermediary retired)
Some checks failed
build / build (push) Has been cancelled
- net.fabricmc.fabric-loom 1.16-SNAPSHOT (no remap; MC 26.1+ ships unobfuscated)
- gradle.properties: minecraft_version=26.1.2, loader=0.19.2, fabric-api=0.149.0+26.1.2
- Java 25 toolchain
- fabric.mod.json: fabricloader>=0.19.0, java>=25
- Drop multi-version build script + matrix CI (single-target now)
- Backup of 1.21.6/7/8 working tree preserved on mc-1.21.x branch

Source migration to Mojmap names is in progress on follow-up commits;
this commit alone will not build until source files are ported.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 19:09:59 +09:00
tkrmagid
ddc16f3d90 M2-M8: renderer, playback backends, GUI/network, commands, multi-version build
Some checks failed
build-matrix / build (0.120.1+1.21.6, 1.21.6, 1.21.6+build.1) (push) Has been cancelled
build-matrix / build (0.129.0+1.21.7, 1.21.7, 1.21.7+build.8) (push) Has been cancelled
build-matrix / build (0.136.1+1.21.8, 1.21.8, 1.21.8+build.1) (push) Has been cancelled
- M2: VideoAnchorRenderer draws width\u00d7height quad oriented by facing
- M3: VideoBackend interface + JavaCV (reflection) and WaterMedia (probe) backends
- M4: VideoConfigScreen GUI + 4 typed payloads + NBT persistence via ReadView/WriteView
- M5: stick item useOnBlock place/edit, AttackBlockCallback delete, /videoPlace /videoDelete /videoMute
- M6: per-tick distance attenuation gain = volume * clamp(1 - d/16, 0, 1), mute zeroes gain
- M7: WatermediaProbe (reflection-only; reports unavailable until v2 supports 1.21.6+)
- M8: multi-version build script (1.21.6/1.21.7/1.21.8) + Gitea Actions matrix workflow
2026-05-15 10:45:28 +09:00
tkrmagid
4094e492b9 feat(M1): Fabric scaffold for MC 1.21.6 with /videoStick
- video_player mod id, 영상재생모드 display name
- VideoAnchorBlock + VideoAnchorBlockEntity (placeholder)
- VideoStickItem
- /videoStick (+ /videostick alias) command gives the stick
- gradle 9.5.1 wrapper, fabric-loom 1.16.2, Java 21 toolchain
- works in both singleplayer and dedicated server (environment: *)
2026-05-15 00:56:35 +09:00