Skip to content

Keep the cloud platform out of the ground - #120

Merged
Hugman76 merged 2 commits into
devfrom
claude/issue-117-yn2ptw
Aug 27, 2026
Merged

Keep the cloud platform out of the ground#120
Hugman76 merged 2 commits into
devfrom
claude/issue-117-yn2ptw

Conversation

@Hugman76

Copy link
Copy Markdown
Member

Closes #117.

The problem

SpawnCloudPlatformPowerUpAction always dropped the platform at playerY - 0.5 - height, which is a block and a half under the player's feet. Used from the ground, that is inside the floor.

The fix

The spot is now searched for from that ideal height upwards, in quarter-block steps, up to the player's feet — the first one free of blocks wins. When the platform had to be raised, the player is teleported onto its top, so they end up standing on a platform above the ground rather than next to one buried in it. The existing upward nudge stays, so they still hop slightly and land back on it.

Two details worth calling out:

  • Only a one-block-wide column around the player is tested for blocks. The platform is four blocks wide, and testing it whole would refuse to place it anywhere near a wall; what decides whether it is "in the ground" is the column the holder stands in.
  • A candidate that would lift the player is only accepted if the player fits there too. If nothing fits — a two-block-high tunnel, say — the action returns FAIL without spending a charge, instead of spawning a platform inside blocks.

Tests

New SpawnCloudPlatformActionGameTest (registered in the game test fabric.mod.json), covering:

  • a platform dropped in mid-air still appears under its holder, who does not move;
  • a platform dropped on the ground does not intersect any block;
  • the player ends up right on top of the platform that had to be raised;
  • with blocks all the way up, nothing is spawned and the trigger fails.

I could not run runDatagen / runGameTest here (no JDK 25 in this environment, the project targets release 25), so the suites are left to CI.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

CI is red on Build the project (Java 25, on ubuntu-latest), on a failure this branch does not cause:

mubble-gametest:koopa_shell_game_test_anownerless_red_shell_goes_straight:
a shell nobody threw should have nothing to chase on tick 20

The same test fails identically on the base: run #183 is the last run of the branch merged as #115, 134 tests, same single failure. This branch adds 4 tests (138 total) and they all pass; the build and the unit tests are green.

The test and the shell disagree on purpose rather than by accident: KoopaShellGameTest documents "it only looks for a target on behalf of whoever threw it, so a shell without an owner never homes at all", while RedKoopaShell.findTarget says "an owner-less shell, thrown by a dispenser for instance, still homes in: it just has no one to spare" and does exactly that. Whichever of the two is meant to win is a call for this repo, so it is left alone here rather than folded into this PR.


Generated by Claude Code

The cloud power-up dropped its platform a block and a half under the
player's feet, which put it inside the floor whenever it was used from
the ground: a platform buried in blocks is one nobody can stand on.

The spot is now looked for from that ideal height upwards, until one
free of blocks is found, and the player rides up with the platform when
it had to be raised. Only the column the player stands in is checked,
since the platform is four blocks wide and testing it whole would refuse
to place it anywhere near a wall. With nowhere for it to go, the action
fails instead of spending a charge on a platform inside the ground.

Closes #117

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WsfRkRhL8WipUenLPAWJUD
@Hugman76
Hugman76 force-pushed the claude/issue-117-yn2ptw branch from aaff175 to 28c26c4 Compare August 24, 2026 16:34

Copy link
Copy Markdown
Member Author

Rebased onto the updated dev (26.2 port, unrelated to this change — no conflicts). CI on the rebased commit (run #32751576319) shows the same, single pre-existing failure as before: koopa_shell_game_test_anownerless_red_shell_goes_straight. All 138 game tests otherwise pass, including the 4 new ones for this fix.


Generated by Claude Code

@Hugman76
Hugman76 merged commit 3aeaa82 into dev Aug 27, 2026
1 check passed
@Hugman76
Hugman76 deleted the claude/issue-117-yn2ptw branch August 27, 2026 20:02
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.

2 participants