Skip to content

Golem 0.2.0

Choose a tag to compare

@achedon12 achedon12 released this 07 Oct 20:14
· 38 commits to main since this release
9a5bae0

Golem 0.2.0 makes golems behave much more like real players, and covers what most PocketMine servers are built from: minigame maps, menus, scoreboards, NPCs and virions.

yield $steve->walk(25, 0);                        // walls, gravity and fall damage included
$steve->chat('/shop');
yield $steve->waitForWindow();
$steve->clickSlot(0);                             // works with InvMenu
$this->assertScoreboardContains($steve, 'Online: 2');

Upgrade with composer update achedon12/golem; the GitHub Action (achedon12/golem@v0) picks it up automatically.

Added

  • assertSoundPlayed(), assertPacketSent() and Golem::sounds() (#5).
  • #[FreshWorld] and $this->freshWorld() to run a test in its own throwaway world (#8).
  • --watch re-runs the tests whenever the plugin or its tests change (#24).
  • Inventory menus: window(), waitForWindow(), clickSlot(), closeWindow(), assertWindowOpen()
    and assertNoWindowOpen(). Works with InvMenu (#23).
  • Golems answer NetworkStackLatencyPacket pings and acknowledge re-sent containers like a real
    client, which InvMenu and some anti-cheats wait for.
  • #[World('path')] and $this->loadWorld() to run a test in a copy of a world folder (#22).
  • Golem::interactEntity(), Golem::respawn(), assertDead() and assertAlive() (#21).
  • Golem::scoreboard(), Golem::bossBar(), assertScoreboardContains() and assertBossBar() (#20).
  • #[DataProvider] to run a test once per data set (#19).
  • assertKicked() and Golem::disconnectReason() (#18).
  • Golems move: walkTo(), walk(), jump(), sneak() and sprint(), with collisions, step-up,
    gravity and fall damage (#6).
  • Virions: the libraries listed in .poggit.yml are loaded (and downloaded from Poggit when
    needed), plus any listed in extra.golem.virions (#7).
  • Documentation website at https://achedon12.github.io/golem/ and a wiki, both generated from docs/.

Fixed

  • assertBlockAt() loads the chunk it checks, which used to read as air when no golem was nearby.
  • Virion downloads verify the TLS certificate (PocketMine's Internet helper does not), only
    follow HTTPS redirects, and are rejected unless they are virion phars.
  • .poggit.yml is only looked up in the plugin folder and its parents inside the same git
    repository.
  • Golems now receive packets broadcast by the world (sounds, particles, entity animations), which
    previously bypassed their inbox.

Full documentation: https://achedon12.github.io/golem/