Skip to content

v0.1.7

Choose a tag to compare

@Pencea-Flavius Pencea-Flavius released this 25 Jul 22:05

Mob::canSpawn was never ported. The spawner's own check only clears a
1x1x2 column of blocks, and MCPE relies on canSpawn to then test the
mob's REAL bounding box against solid boxes, entities and liquid. Without
it a wide mob (spider) or one landing in a non-blocking full cube (ice,
leaves, glass -- all neverBuildable, so the column check reads them as
empty) spawned embedded in the ground. All three spawn sites now go
through it, animals included; Level::containsAnyLiquid is implemented for
real instead of returning false.

Archery drifted in several places at once, all of them upward:

  • the muzzle nudge was 0.2 along the AIM direction, so the steeper the
    shot the higher it started. MCPE offsets 0.16 sideways and 0.1 down,
    which does not move with pitch. Skeletons, which always shoot lofted,
    paid it every time.
  • added Mob/Player getHeadHeight, and the skeleton now takes its muzzle
    and aim point off the entity anchors like Skeleton.cpp does.
  • speed 1.6 and uncertainty 32 for skeletons (was 1.65, dead accurate).
  • damage is ceil(speed * 2) with a random crit bonus, not a flat 4/6.
  • arrows bounce off a refused hit, can hit their own shooter after 5
    ticks, re-fly when the block DATA changes, and ease their nose toward
    the velocity instead of snapping.
  • the entity NBT now writes MCPE's byte types, so a world with stuck
    arrows round-trips with the real game.

Liquid tests were a single block sample at feet+0.4, which is why mobs
could not swim: buoyancy lifted the sample point out of the water, the
land branch took over, they sank, and repeat. They now use the whole
bounding box like MCPE, shrunk 0.4 vertically (0.1 on x/z for lava) at
the Entity level, with the liquid surface-height gate and the hasChunksAt
early-out from checkAndHandleWater. Two early returns this port added to
PathfinderMob::updateAi skipped MCPE's paddle-while-in-liquid tail
entirely, so a mob chasing you at close range sank the moment it reached
you; every exit goes through applySwimUrge now.

Also: the arm pivots ride the body twist during a swing (HumanoidModel
sets arm0/arm1 x and z from body.yRot), for the player, item-holding mobs
and zombies. Without it the shoulders stayed put while the torso turned
and the held item slid out of the fist mid-swing.