Skip to content

Blockhaven: chests, beds and skulls on Java's block-entity models and textures - #77

Merged
eklonofficial merged 12 commits into
eklonofficial:mainfrom
k1519035:blockhaven-block-entities
Oct 3, 2026
Merged

eklonofficial merged 12 commits into
eklonofficial:mainfrom
k1519035:blockhaven-block-entities

Conversation

@k1519035

@k1519035 k1519035 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Stacked on #67 (block models). Review that one first; this PR's own change is the top commit. It doesn't depend on the mob PRs.

What
Chests, beds and skulls are now built the way Java's block-entity renderers draw them:

  • Chest (ChestRenderer): the 14×10×14 base, plus the lid and latch on their hinge. The animated lid now swings on Java's hinge, 9 px up and 1 px in.
  • Bed (BedRenderer): each half laid flat and turned by facing, with its two corner legs. The pillow sits at the head end.
  • Skull (SkullBlockRenderer and SkullModel): the 8×8×8 head, turned to its facing. This covers both the skeleton and wither skeleton skulls.

Pack support
Every face is textured from Java's block-entity sheets, unwrapped exactly as ModelPart.Cube does it:

  • entity/chest/normal
  • entity/bed/red
  • entity/skeleton/skeleton
  • entity/skeleton/wither_skeleton

The sheets are cut into 16×16 block layers (new SHEETS in data/blocks.js). A new mesher emitter, jcube, splits each face where it crosses from one tile into the next. That way, a resource pack's sheet maps onto the block texel for texel; packs used to skip these blocks entirely. Without a pack, the sheets are painted from the existing tiles, so the default look stays familiar.

Testing

  • npm test passes.
  • Checked in the local block lab with the vanilla 1.20.1 pack: all four facings of chests, beds and skulls render correctly, with the latch, pillow and faces in the right places.
  • Checked the generated look without a pack.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG

Copilot AI balanced review requested due to automatic review settings October 3, 2026 04:14
@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

@k1519035 is attempting to deploy a commit to the Marin Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

k1519035 and others added 12 commits October 3, 2026 09:14
…inventory preview

The player is Java's PlayerModel (64x64 skin with its outer layer, slim arms) unwrapped
exactly as ModelPart.Cube, posed by a port of HumanoidModel.setupAnim. Players can load
their own Minecraft skin (64x64 or classic 64x32). Armor is Java's two-layer armor model,
using a pack's textures/models/armor when present. The inventory shows the live model
turned towards the pointer. Also fixes the elytra wind code throwing in the rain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
Its angles came out NaN until the first mouse move, so the preview stayed empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
…from your own game

Zombie, husk, drowned, skeleton, stray and wither skeleton use Java's ZombieModel,
DrownedModel and SkeletonModel meshes and texture layouts, posed by HumanoidModel.setupAnim
with Java's zombie and skeleton arm animations. A resource pack's entity textures replace
their painted skins, and the stray's clothes and the drowned's outer layer are drawn as in
Java. tools/pack-from-jar.mjs builds a resource pack of the official textures from the
player's own installed Minecraft (launcher, Modrinth, Prism or CurseForge), never committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
Villagers (with their biome and profession layers), wandering traders, zombie villagers,
witches, pillagers, vindicators, evokers, piglins and zombified piglins use Java's
VillagerModel, WitchModel, IllagerModel, PiglinModel and ZombieVillagerModel, posed by
their setupAnim (folded arms, spellcasting, crossbows, axe swings, flapping ears). Entity
texture layers grow to 128x128 so Java's taller textures (the witch's 64x128) fit, and a
model face's painted decoration no longer spills onto another face's pixels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
Pig, cow, mooshroom, sheep (with its tinted wool layer), chicken, wolf (tame and angry
skins, sitting), fox, polar bear, goat, llama, horse and donkey use Java's model geometry
and texture layouts, posed by their setupAnim; mooshrooms carry Java's mushrooms. Their
painted looks carry over, and a resource pack's textures/entity images replace them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
Checked every model against the LayerDefinitions 1.20.1 builds: quadruped legs share one
unmirrored texture, the goat's ears are 3 wide and its goatee mirrored, and armor legs are
inflated 0.1 less than the rest (HumanoidArmorModel).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
…dels

Creeper, spider and cave spider, enderman, slime, magma cube, silverfish, endermite, blaze,
ghast and phantom now use Java 1.20.1's own model geometry and texture layouts (checked against
the LayerDefinitions the game builds), so resource packs skin them, with their setupAnim poses:
splayed spider legs, the enderman's clamped stride and screaming jaw, magma slices parting as it
squishes, circling blaze rods, swaying tentacles, beating phantom wings. Also CreeperRenderer's
swell, the slime squish and its see-through outer jelly (a new translucent mob pass), the eyes
layers, the ghast's 4.5x size and its shooting face.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
Iron golem, snow golem, hoglin, strider and ravager now use Java 1.20.1's model geometry and
texture layouts (checked against the game's LayerDefinitions), with their setupAnim /
prepareMobModel poses: the golem's triangle-wave stride and two-armed slam, the snow golem's
turning body, the hoglin's flapping ears and goring head, the strider's bobbing body and
streaming bristles, the ravager's lunging neck and snapping jaw. Also the iron golem's walk
lurch and crackiness layers, the snow golem's carved pumpkin, and the strider's cold skin,
shiver and saddle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
…n Java's models

Squid and glow squid, cod, salmon, tropical fish, pufferfish (all three puff states), guardian
and elder guardian, dolphin, turtle and axolotl now use Java 1.20.1's model geometry and texture
layouts (checked against the game's LayerDefinitions), with their poses: squid tentacles pulsing
and the body pitching and spinning as it swims (Squid.aiStep, SquidRenderer), tails swishing and
stranded fish flopping on their sides, puffer fins, the guardian's spikes drawing in as it swims,
its eye turned to its target and its swaying tail, the dolphin's bob, turtle flippers paddling or
hauling it ashore, and the axolotl's swim, hover, crawl and rest. Tropical fish are tinted by
their base and pattern colours over the pack's white textures, as Java draws them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
… on Java's models

Rabbit, ocelot, panda, parrot, bat, frog and camel now use Java 1.20.1's model geometry and
texture layouts (checked against the game's LayerDefinitions), with their poses: the rabbit's
jump kick, the ocelot's tail curling with its stride, the parrot perched, walking or flying with
Parrot.calculateFlapping's wingbeat, the bat's flight and bob. The frog and camel play Java's own
keyframe animations (FrogAnimation, CamelAnimation, extracted from the game) through a port of
KeyframeAnimations: the frog's hop-walk, swim stroke, leap and treading water, the camel's walk,
with its saddle, bridle and reins shown when saddled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
The wither (WitherBossModel, at twice its size, breathing and looking about) and the ender
dragon (DragonModel, 256x256) now use Java 1.20.1's geometry and texture layouts. The dragon is
drawn as EnderDragonRenderer draws it: a 64-tick history of its heading and height (EnderDragon's
latency positions) lays its five neck pieces and twelve tail pieces along the path it flew, the
body rolls into turns, the whole dragon pitches with its climb, the wings beat and the jaw works
with its flap time, and perched the neck bows to the ground.

Entity textures bigger than the 128x128 layer (the dragon's) are kept at a fraction of their
size; models without a Java texture size (the saddle, elytra) keep loading from packs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
… textures

Chests, beds and skulls are now built as Java's ChestRenderer, BedRenderer and SkullBlockRenderer
draw them: the chest's base, lid and latch, the bed halves laid flat with their corner legs, and
SkullModel's head, each placed and turned the same way, with every face textured from Java's
block-entity sheets (entity/chest/normal, entity/bed/red, entity/skeleton/skeleton and
wither_skeleton) exactly as ModelPart.Cube unwraps it. The sheets are cut into 16x16 block
layers (faces are split where they cross from one into the next), so a resource pack's sheets
now apply to them; without one, sheets painted from our own tiles keep the familiar look. The
animated chest lid swings on Java's hinge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5yMmGQVzFD1XVDyZe42KG
@eklonofficial
eklonofficial force-pushed the blockhaven-block-entities branch from 3a836e2 to b80a534 Compare October 3, 2026 14:16
@eklonofficial
eklonofficial merged commit 4647fa4 into eklonofficial:main Oct 3, 2026
2 of 3 checks passed
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.

3 participants