Repository navigation
Built for BDS 1.26.51 and LeviLamina 26.51.7. PIER_ABI_VERSION stays at 2 and no slot moved,
new ones only went on the end: a mod built against 26.51.2 loads unchanged. pier-sys-rs is 26.51.3
and pier-rs 2.2.0; nothing public was removed from either (contract §2.5).
Added
- A command can be run as a player.
player_execute_commandis appended to the end of
PierApiwithPIER_ABI_VERSIONunchanged (contract §2.2): a mod built against an earlier
release loads as before, and a mod built against this one reports a missing slot on an older
host rather than calling through a short table. The player is the origin of the command, so
@sis the player, relative coordinates are the player's position and the permission level
the engine sees is the player's own, whereexecute_commandkeeps running at the console's.
One leading slash is accepted and dropped. The output reaches the same kind of sink. The
binding methods arePlayer::execute_commandin Rust,Player.ExecuteCommandin Go and
Player.executeCommandin Zig, and the commands guide has a section for it in English and
Chinese. - A caller can ask whether a player has finished joining, and list the engine's commands.
PIER_PPROP_IS_INITIALIZED(36) is appended to the properties ofplayer_get_num, and
PIER_REGISTRY_COMMANDS(3) to the kinds ofregistry_list. Both are values appended to
existing enumerations: no slot was added or moved,PIER_ABI_VERSIONis unchanged, and a
mod built against an earlier release loads as before. A host older than this one answers
false for either value. The property reads 1 for a player whose client has finished
joining, the moment from which an ability can be written, and for a simulated player, which
has no client to wait for; it is the same test the ability write guard applies. A command
entry carries the name, the description, the permission level, the raw flag bits, whether
the command is hidden from players, and its aliases, and every registered command is
listed whichever mod registered it. The binding methods arePlayer::is_initializedand
registry::commandsin Rust,Player.IsInitializedin Go andPlayer.isInitializedin
Zig. - A spawn payload names its entity without the initialization event and carries the engine's
own type number. The_identifierobject of an event gainscanonical, the
namespace:namewithout the<event>thatfullcan carry after it, andtype, the
actor type number the engine gives that name. The bits oftypesay whether the entity is a
mob, a monster, an animal or a water animal, as in an entity entry ofregistry_list, so a
consumer decides whether a spawn is a monster from the engine and keeps no list of names. A
spawn whose identifier LeviLamina writes as plain text gets the same object. The existing
fields are unchanged. - Twelve events the engine and LeviLamina have no event for are raised by the host. Each is
cancellable unless noted, and each is named inALL_SYNTHETIC.HopperSearchItemEventand
HopperPushOutEventask before a hopper or a hopper minecart moves an item, and unlike
HopperTransferEventthey carry the dimension.DispenseItemEventasks before a dispenser
ejects an item andCommandBlockExecuteEventbefore a command block or its minecart runs a
command, neither of which has a player.WitherDestroyEventasks before a wither breaks the
blocks around it.RespawnAnchorExplodeEventandPlayerUseRespawnAnchorEventask before a
charged anchor explodes outside the nether or becomes a spawn point inside it.
PlayerAttackBlockEventasks before mining starts, earlier than the observation-only
PlayerStartDestroyBlockEvent.PlayerUseBucketPlaceEventandPlayerUseBucketTakeEventask
before a bucket puts a liquid down or takes one up.PlayerConsumeTotemEventasks before a
totem saves a player.PlayerStopSleepEventis the observation-only other half of
PlayerSleepEvent. The hook points follow LegacyScriptEngine and iListenAttentively, and the
acknowledgements page lists which reference each came from. - Eighteen more events are raised by the host, and
PlayerRequestItemActionEventis no longer a
name nothing raises. Cancellable:ExplosionBlocksEvent,BlockInteractedEvent,
NpcCommandEvent,PlayerPullFishingHookEvent,PortalSpawnPigZombieEvent,
ActorGetEffectEvent,PlayerSetArmorEvent,PlayerOpenInventoryEvent,
PlayerOpenContainerScreenEventandPlayerRequestItemActionEvent, which hooks the three item
stack request handlers and answers a refusal with the engine's own error result, so the client
puts its screen back. Observation only, because the engine tells a mod after the change:
PlayerCloseContainerEvent,ContainerChangeEvent,PlayerInventoryChangeEvent,
ScoreChangedEvent,ActorRemoveEffectEvent,ProjectileHitEntityEvent,
ProjectileHitBlockEventandActorTransformEvent. The hook points follow
LegacyScriptEngine and iListenAttentively. Two events of the latter are left out on purpose,
the enderman's block events and the redstone update, because they write the engine's own logic
out a second time inside the detour. - Seven more events cover what no player does. All are cancellable.
ActorDestroyBlockEvent
andActorPickupItemEventask before a mob changes a block and before any actor picks an item
up, through the engine's own listener, where a refusal is its Cancel.ActorChangeDimensionEvent
asks before an actor that is not a player goes to another dimension.DragonEggTeleportEvent,
BlockFallEvent,SculkBlockGrowthEventandDragonRespawnEventask before a dragon egg
jumps, before a block that lost its support falls, before a sculk charge is spent, and before
the end fight makes the dragon again. The hook points are iListenAttentively's. Its falling
block and dragon egg events write the engine's logic out a second time inside the detour,
which these do not. ExplosionBlocksEventlets a subscriber keep chosen blocks out of an explosion. It is asked
after the engine has the set of blocks a blast reaches and before it reads the set back, with
the cells in the payload, and the reply may carrykeep:[[x,y,z],...].ExplosionEventcan
only refuse the whole blast, so a plot that wants the bang and its own blocks standing now has
the finer event. The host reads the reply with a newdispatchHookEventKeeping, which takes the
union of what every subscriber keeps and logs an element it cannot read.- The
MobGriefingdimension rule also stops what mobs do to blocks outside an explosion.
It stopped only mob-caused explosions, so an enderman kept picking blocks up and putting them
down and a wither kept breaking walls in a dimension that forbade it. Every mob that asks the
engine's listener before changing a block is now refused with the engine's own Cancel, which is
EventCoordinatorPimpl<ActorEventListener>::_processEvent. The enderman's two goals are
refused atcanUseas well, where a refused goal never starts, and the wither at
WitherBoss::_destroyBlocks. Together the dimension rules use fifteen hook points, and
nothing changes for a dimension nobody set a rule for. - The READMEs and the documentation thank the projects Pier learned from. LeviLamina,
LegacyScriptEngine, iListenAttentively, MoreDimensions and LegacyMoney each have a section in
both READMEs and a page of the guide, with the hook points and behavior each one is the
reference for.
Changed
- The host builds with clang-cl, and
clno longer builds it. LeviLamina 26.51.7 declares
EventCoordinatorPimpl::_processEventas an inline member template markedMCAPI.clstops on
it with C2491 wherever a coordinator is instantiated, andActorGameplayEvents.cppand
DimensionRules.cpphook that function by address: withMCAPIemptied to get past the error,
the address would be the header's own body, which only returns a default, and the hooks would
install and never fire.xmake.luanow selects clang-cl for every target,build.batand the
three workflows pass--toolchain=clang-cl, the workflows' cache key names the toolchain because
the levilamina package installs to a different directory under it, and the two hooking files
stop with an#errorunder any other compiler. All 137 translation units compile and the host
links. Whether those two hooks fire needs a server.
Fixed
- Explosions are caught wherever they come from. The
ExplodeBlocksandMobGriefing
dimension rules andExplosionEventhooked the eight-argumentLevel::explodeoverload
only, and a creeper or a lit TNT broke blocks in a dimension that forbade it while no
subscriber saw the explosion. Both now hookExplosion::explode, which every explosion
runs and which carries its ownBlockSourceand source actor. The event's payload and its
cancel behavior are unchanged, and the rules still leave the blast, the damage and the
particles alone and clear only the block-breaking bit. FireSpreadstops new fire as well. The rule blockedFireBlock::checkBurn, the step
that burns or ignites a neighbor, and left the fire a ticking fire block places in the
cells around it. A fire tick in a dimension that forbids the rule now has
FireBlock::mayPlacerefused for every cell except its own, inside theonPlacethe
placement runs. The fire keeps aging in place, and a fire placed outside a tick, flint
and steel included, is not affected.- The dimension rules are enforced on a server with no custom dimension. The hooks
that carry outmd_set_dimension_rulewere installed when the dimension manager was
constructed, and that happens when the first custom dimension is registered. On a server
whose worlds are all vanilla every rule was accepted and none was enforced: liquid kept
flowing, pistons kept pushing, fire kept spreading and explosions kept breaking blocks.
The firstmd_set_dimension_rulenow installs them. Each hook is installed on its own,
and one that does not take is logged with the engine function it was for, where
HookRegistrarreturned nothing and a failed hook left no line. - Two events that share a detour no longer refuse the second subscription.
PlayerRideEventwithActorRideEvent, andPlayerStepOnPressurePlateEventwith
ActorStepOnPressurePlateEvent, each ranhook()on the same detour from its own
installer, and the event subscribed second was refused with the native-detour line. Both
events of a pair now call one installer that installs once. Thehook-install-oncecheck
readspier-hooksfor a detour named twice in one file. - Two files include the types their objects own.
SpecDimension.cppbuilds
OverworldGeneratorMultinoiseandTheEndGenerator, whose defaulted destructors delete a
Cavifier, aChunkBlender, aChunkBlenderFactoryand aSimplexNoise, and aChunkBlender
holds a vector ofChunkBlenderUtil::AttenuationData; the headers only forward-declare them and
clang-cl reports an incomplete type instd::default_delete.TransformEvent.cppnamed
OwnerPtr<EntityContext>withoutGameRefsEntity.h, which defines theGameRefs<EntityContext>
it derives from. Both files now include what they use. - The docs named LeviLamina 26.51.5 as the requirement while
xmake.luapins 26.51.7. The
README badge and text, the installation table, the compatibility table,manifest.jsonand the
pier-rs package metadata now say 26.51.7, and the compatibility table has a row for this release. - The
ledger-covers-treecheck no longer reports the C++ example's build output.
hello_pier_cpp.dll,.exp,.libandobj/were ignored by.gitignoreand not by the check's
exemption lists, which have to be kept level with it by hand. - Comments and docs that disagreed with the code now agree with it. The guide pages and
the Rust events page said Pier synthesizes 29 events where it registers 69. The payload docs
of five events (ExplosionEvent,FarmlandDecayEvent,PistonPushEvent,ChestPairEvent,
SpawnItemActorEvent) left out thepartialfield the hook writes when a read fails, and
the headers of five hook files did the same. The ride and pressure-plate headers named only
the player event and left out the actor event registered beside it. Several comments named a
function, file, type or test that does not exist, and two claimed a guarantee the code does
not give: the assertions innumberOfdo not reject a collapsed cast, and the profiler
detours are unpatched again when one of the five fails to attach. No behavior changed.