Skip to content

Add configurable theater screens, auditorium audio, remote controls, and Screenwriter automation - #6

Open
Emerald-Railroad wants to merge 1 commit into
Samarth-programming:mainfrom
Emerald-Railroad:theater-screenwriter-features
Open

Emerald-Railroad wants to merge 1 commit into
Samarth-programming:mainfrom
Emerald-Railroad:theater-screenwriter-features

Conversation

@Emerald-Railroad

Copy link
Copy Markdown

PixelReel Custom Fork v1.0.0 — Theater Screens, Independent Auditorium Audio, Remote Control, and Screenwriter Automation

Summary

This PR turns PixelReel into a more complete movie-theater playback and automation system while preserving the existing PixelReel media-provider foundation.

The largest additions are:

  • configurable flat and curved cinema screens;
  • auditorium-shaped, truly independent per-screen audio;
  • a long-range Remote Control with local playback reconnection;
  • the Screenwriter central scheduling console;
  • automatic daily Jellyfin/Plex movie scheduling for up to 30 linked auditoriums;
  • persistent schedules, restart synchronization, schedule books, chat output, and theater-management commands.

The internal Fabric mod id remains pixelreel so existing registry IDs/worlds continue to load. The displayed release identity is PixelReel Custom Fork v1.0.0.


1. Custom Cinema Screens

The normal user-facing display lineup is reduced to two theater-focused screens:

Custom Cinema Screen

  • Flat screen.
  • Uses the regular Cinema Screen item appearance/recipe slot.
  • Dynamically sized at placement time.

Custom Curved Cinema Screen

  • Uses PixelReel's original curved-screen profile but applies it to dynamic dimensions.
  • Uses the Curved Cinema Screen item appearance/recipe slot.

Placement workflow

Right-clicking either custom screen item opens a setup menu containing:

  • width;
  • height;
  • audio depth;
  • audio side range.

The server validates all requested panel cells before placement. If any required space is blocked, unloaded, or outside the allowed world area, placement is rejected and the item is not consumed.

Supported custom dimensions are 1–64 wide and 1–36 high, with a default of 27×11. Custom geometry and audio settings are persisted in DisplayBlockEntity and synchronized to clients.

Mounting and removal

Flat custom screens are positioned against the back face of their occupied block cells, allowing a screen placed directly in front of a wall to appear flush rather than floating toward the player.

Generated panel blocks are breakable. Breaking any panel resolves its controller and destroys the complete bound screen. The controller remains the only item-dropping part, preventing duplicate drops.

Legacy preset screen registrations remain internally so existing worlds are less likely to lose registry references, but those preset screens are removed from the normal creative/crafting lineup.


2. Auditorium Audio System

The original distance-based/shared VLC audio model was not suitable for adjacent theater auditoriums. This PR replaces it with an auditorium-zone model.

Audio zones

Each custom screen stores:

  • forward/depth range;
  • left/right range beyond the physical screen edges.

Defaults are:

  • 40 blocks forward;
  • 2 blocks beyond each horizontal edge;
  • 1 block behind the screen so standing directly against a wall-mounted screen does not cut audio off.

Inside the zone, audio stays at the screen's configured volume. There is no distance fade. Outside the zone, the screen is silent.

If zones overlap, the client selects a single eligible screen rather than intentionally mixing multiple auditorium tracks.

True per-screen audio isolation

Separate VLC player objects alone were not sufficient because native LibVLC volume/mute behavior can still be shared at the process level.

The playback path was therefore changed so each screen receives decoded PCM audio through LibVLC callbacks. Each ChannelPlayer owns its own JavaSound output path. Inactive screens discard/flush their PCM rather than relying on shared native VLC volume state.

This gives each physical screen an independent audio track and makes it possible to walk from Auditorium A to Auditorium B and hear only the screen whose configured audio zone contains the local player.


3. Remote Control

A new Remote Control item provides long-range interaction with PixelReel screens.

Normal use

Hold the remote, aim at a PixelReel screen/panel, and right-click to open that screen's normal controls from a distance.

Reset Connection

The control UI now includes Reset Connection.

This is a client-local recovery action for cases where VLC/video/audio becomes desynchronized after moving between auditoriums. Reset Connection:

  1. tears down the selected screen's local playback/audio session;
  2. leaves server-side movie state and other players unchanged;
  3. creates a fresh local connection;
  4. reconnects at the screen's current synchronized playback position.

New on-demand sessions also use the current synchronized playback position rather than blindly beginning from the original movie start.

Crafting recipe

II
RB
II
  • I = Iron Ingot
  • R = Redstone
  • B = any Minecraft Button

4. Screenwriter Console

Screenwriter is a central movie-theater automation system inspired by real theater scheduling software.

The console can manage up to 30 linked custom cinema screens.

Console controls

  • Right-click with an empty hand — select/arm the console for screen linking and show a quick status overview.
  • Shift + right-click with an empty hand — toggle Screenwriter automation ON/OFF.

The link-arm state lasts two minutes.

Linking a screen

  1. Right-click the Screenwriter Console.
  2. Hold the Remote Control.
  3. Sneak + right-click a custom cinema screen.
  4. Enter the desired auditorium number.
  5. Choose Link / Update or Unlink.

Auditorium numbers are user-selected rather than assigned by link order. Valid numbers are 1–30, and duplicate auditorium numbers are rejected.

Re-linking an existing screen can change its auditorium number. If today's generated schedule contains entries for the old number, those entries are migrated to the new auditorium number.


5. Automatic Daily Scheduling

Screenwriter uses the real system/server date and clock rather than Minecraft day/night time.

When enabled and linked screens exist, it creates a schedule for the current real-world date. The schedule is saved so restarting the Minecraft server does not reroll the day.

Media providers

Screenwriter schedules movies from PixelReel's existing on-demand catalog layer and supports:

  • Jellyfin;
  • Plex;
  • AUTO provider selection.

AUTO uses Jellyfin when it is configured/enabled, otherwise Plex.

Only movie entries with usable runtime metadata are eligible.

Scheduling rules

For every linked auditorium, Screenwriter:

  1. determines the first show offset within the configured opening stagger window;
  2. randomly chooses an eligible movie that can finish before closing;
  3. calculates the exact end time from the provider runtime;
  4. adds the configured turnaround interval;
  5. rounds later showtimes to the configured clean interval;
  6. repeats until another eligible movie cannot fit before closing.

Default settings:

  • Opening: 11:00 AM
  • Closing: 11:30 PM
  • Turnaround: 20 minutes
  • First-show stagger window: 30 minutes
  • Later-show rounding: 10 minutes

First-show staggering

Previously, every auditorium began its first show exactly at opening time. Screenwriter now distributes first shows across the configured stagger window.

For example, a theater with multiple linked screens and a 30-minute stagger can start auditoriums progressively between approximately 11:00 and 11:30 instead of producing one large simultaneous provider connection burst.

/screenwriter stagger 0 disables staggering.

Three-day no-repeat rule

Screenwriter stores media history by date.

A movie used on a schedule during any of the previous 3 calendar days is blocked from the current day's random pool. A movie is also used at most once in the same generated day.

If the remaining eligible pool cannot fill an auditorium, Screenwriter leaves that remaining time unscheduled instead of violating the history rule.


6. Scheduled Playback and Restart Synchronization

The generated schedule is not only informational—Screenwriter actively controls linked displays.

While a show is scheduled:

  • the correct on-demand title is loaded on the auditorium display;
  • the display is powered/unpaused as needed;
  • playback starts at the correct schedule-relative position.

Between shows, Screenwriter powers its controlled screen off.

Restart behavior

The current schedule is stored in:

<world>/pixelreel-screenwriter.json

If the server shuts down and comes back while a show is already in progress, Screenwriter calculates:

current real time - scheduled start time

and starts the movie at that elapsed playback position.

A restart therefore does not restart every movie from 00:00 and does not regenerate the schedule.

When the calendar date changes, the next day's schedule is generated when Screenwriter is enabled and at least one screen is linked.


7. Screenwriter ON/OFF Behavior

Screenwriter can be disabled without deleting its configuration/history.

Turning it OFF:

  • stops Screenwriter-controlled screens;
  • prevents new daily schedules from being generated;
  • preserves linked auditoriums, history, and saved schedule data.

Turning it back ON resumes automation and generates the current day's schedule when appropriate.

Controls:

/screenwriter on
/screenwriter off

or Shift + right-click the Screenwriter Console.


8. Schedule Chat and Written Book

Chat

/screenwriter schedule

prints the complete generated schedule in chat.

Written book

/screenwriter book

gives the player a written book titled Today's Movie Schedule.

The book formatter:

  • groups shows by auditorium;
  • includes show start/end times and movie titles;
  • wraps long titles;
  • continues the same auditorium onto additional pages when necessary rather than truncating the schedule.

9. Screenwriter Commands

/screenwriter
/screenwriter status
/screenwriter on
/screenwriter off
/screenwriter schedule
/screenwriter book
/screenwriter generate
/screenwriter regenerate
/screenwriter source <auto|jellyfin|plex>
/screenwriter open <time>
/screenwriter close <time>
/screenwriter turnaround <minutes>
/screenwriter stagger <minutes>

Time input

Minecraft/Brigadier command parsing made colon-formatted time inconvenient, so opening and closing commands accept compact 24-hour values:

/screenwriter open 1100
/screenwriter close 2330

Other examples:

  • 930 → 9:30 AM
  • 9 → 9:00 AM
  • 1830 → 6:30 PM

Colon-formatted values such as 11:00 remain accepted when they reach the parser.


10. Screenwriter Console Crafting and Texture

The console has a custom theater-control/scheduling texture.

Crafting recipe:

III
IRI
DDD
  • I = Iron Ingot
  • R = Redstone
  • D = Polished Deepslate

11. Release/Compatibility Notes

  • Release name: PixelReel Custom Fork v1.0.0
  • Fabric mod id: pixelreel (intentionally unchanged for registry/world compatibility)
  • Build artifact: pixelreel-custom-fork-1.0.0.jar
  • Minecraft target: 26.3-snapshot-5
  • Java: 25+
  • Fabric Loader: >=0.19.3
  • Fabric API: version defined in gradle.properties
  • Client playback still requires a compatible local VLC/libVLC installation.
  • Existing Jellyfin/Plex server-side concurrent-stream limits are outside the mod; Screenwriter staggering reduces simultaneous starts but does not increase provider stream capacity.

12. Suggested Test Matrix

Screens

  • Place flat and curved custom screens at minimum/default/large dimensions.
  • Confirm blocked placement is rejected without consuming the item.
  • Confirm flat screen sits flush against a wall.
  • Break a non-controller panel and verify the entire screen is removed once.

Audio

  • Run two or more different movies simultaneously in adjacent auditoriums.
  • Move between audio zones and confirm only the current auditorium is audible.
  • Stand directly against the screen and confirm the one-block rear allowance prevents immediate cut-off.
  • Test overlapping zones and verify only one screen is selected.

Remote

  • Control a screen from normal remote range.
  • Trigger Reset Connection during active playback and verify it reconnects near the current synchronized timestamp without restarting the show for other players.

Screenwriter

  • Link screens out of order (for example 8, 2, 15) and verify custom auditorium numbers persist.
  • Verify duplicate auditorium numbers are rejected.
  • Generate a schedule and verify first shows are staggered.
  • Verify runtime + turnaround calculations and closing-time fit checks.
  • Restart the server during an active show and verify schedule persistence and elapsed-position resume.
  • Advance to a new calendar date and verify a new schedule is generated only while Screenwriter is enabled.
  • Verify the 3-day history prevents recent movies from being selected.
  • Verify OFF stops automation but preserves state.
  • Verify /screenwriter schedule and the multi-page /screenwriter book contain the full schedule.

Screenwriter load protection (v1.1)

Screenwriter now defaults to OFF in fresh worlds and can cap generated schedules with /screenwriter maxstreams <0-30>. The default is four simultaneous scheduled shows; 0 means unlimited. The scheduler enforces the cap across each movie's full runtime and schedules chronologically across auditoriums so available capacity is distributed fairly. Existing generated schedules are left untouched until /screenwriter regenerate is used.

Add custom theater screens and Screenwriter automation
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