Add minecarts, jukeboxes, name tags and outline-shape picking

Minecarts follow OldMinecartBehavior: rails and slopes, powered and
activator rails, coming off the track, the rider's push, players and carts
pushing each other, placement, breaking and saving, with chest and hopper
containers, furnace fuel and push, and TNT priming and explosions. They
render on the rail between the front and back points with their display
block.

Jukeboxes take jukebox_playable discs, play the song with the rainbow Now
Playing overlay and note particles, emit 15 while playing, drive
comparators, eject the disc and save it.

Name tags name mobs (saved as CustomName); the name shows above the head on
a translucent background when targeted or always visible, and Dinnerbone
and Grumm render upside down.

Blocks are now picked and outlined with their vanilla outline shapes
(exported per state with the edges LevelRenderer draws), so rails, slabs,
torches and plants no longer act as full cubes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-09 03:21:40 +02:00
parent 85a11b071f
commit 95149579ff
21 changed files with 2141 additions and 60 deletions
@@ -822,6 +822,21 @@ impl BlockEntityRenderer {
self.render_one(scene, *pos, kind, base, packed, lights, out);
}
}
/// One block entity of `state` drawn under `base` (minecart contents).
pub fn render_state(
&self,
scene: &Scene,
state: u32,
base: Mat4,
packed: u8,
out: &mut Vec<Vertex>,
) {
let kind = self.kind(state);
if !matches!(kind, Kind::None) {
let lights = diffuse_lights(scene.nether);
self.render_one(scene, [i32::MAX; 3], kind, base, packed, lights, out);
}
}
#[allow(clippy::too_many_arguments)]
fn render_one(
&self,