Skip to content

[1.21.1 / 0.8] Weak Automata targets its own turtle again (regression of #698) #840

Description

@cmoyates

Describe

Possible regression of #698 on the 1.21.1 / 0.8 line: a Weak Automata Core targets its own turtle instead of the block in front. lookAtBlock({yaw=0,pitch=0}) non-destructively confirms the self-hit. An earlier digBlock call interrupted the turtle immediately, and the player observed it apparently mining itself; we stopped destructive testing and verified the target with lookAtBlock instead.

Expected: zero relative yaw/pitch looks forward past the source turtle and reports the front block.

Observed on installed AP 1.21.1-0.8.0a: turtle.inspect() reports ars_controle:scryers_linkage, while the core reports computercraft:turtle_normal at a hit point approximately 0.0045 blocks forward of the turtle center. Turtle was stationary and facing north. Fuel, selected slot, inventory fingerprints and pickaxe damage were unchanged by the look diagnostic.

I searched existing issues/PRs. #698 is closed as completed and concerns an earlier development build. I did not find an open matching report for the current 0.8 line.

Steps to reproduce

  1. In the reported setup, use a normal turtle with Weak Automata Core on the left (Chunky on the right). Keep the turtle stationary, facing north, with a Scryer's Linkage directly in front. The linkage in this setup forwards a barrel inventory; turtle.inspect() verifies its physical block identity.
  2. Perform this non-destructive targeting check (no pickaxe or dig call needed):
local present, front = turtle.inspect()
assert(present, "Place a block directly in front first")
local core = assert(peripheral.wrap("left"))
print("Physical front: " .. front.name)
local hit, err = core.lookAtBlock({ yaw = 0, pitch = 0 })
print(textutils.serialize(hit or { error = err }))
  1. Compare the front block with the ray result. The equivalent single-call diagnostic in our test returned:
-- turtle.inspect():
{ name = "ars_controle:scryers_linkage", state = {} }

-- core.lookAtBlock({yaw=0, pitch=0}), relevant fields:
{
  name = "computercraft:turtle_normal",
  x = 0, y = 0, z = -0.0045000000000001705,
  r = 0, u = 0, f =  0.0045000000000001705
}

Please use the look-only reproduction rather than digBlock on a valuable turtle. Look is non-destructive, not strictly side-effect-free: it updates the upgrade animation charge and round-trips the fake-player inventory. We observed no fuel/item/durability changes during this diagnostic.

Source investigation / newer-version check

Live reproduction is 0.8.0a only. We have not installed or live-tested 0.8.1a or a development build. However, the same apparent missing source exclusion remains in the 0.8.1a tag (02868e922b9a4a1af91cadaaf835c51bd016cfe6) and dev/0.8-1.21.1 (67a8a687189a6eeb14eb8d7fe75d8a5b87f2c948) as checked for this report:

  • FakePlayerProviderTurtle.load at the current 0.8 development commit positions the fake player at (turtle.x+0.5, turtle.y+0.5, turtle.z+0.5) with the turtle's facing, but does not call setSourceBlock.
  • APFakePlayer initializes source = null and exposes a setter. findHit passes that source into the block clipper.
  • HitResultUtil.AdvancedClipContext.getBlockShape skips a block only if source != null && source.equals(pPos).
  • The ray origin is inside the turtle outline. Installed-bytecode review shows both lookAtBlock and digBlock use findHit(true, false); no later self-block exclusion protects digging. A scan of the installed AP 0.8.0a class files found the setter definition but no callers.
  • 0.8.1a release provider likewise does not set the source block. The default dev/1.21.1 branch uses a different, older clipping implementation that explicitly skips blockPosition(); it should not be confused with the 0.8 release/development line.

Likely fix direction: initialize/refresh the source-block exclusion from the turtle's current position whenever loading the fake player, and add regression coverage for self-hit exclusion, including after movement. This is a source-based suggestion, not a patch we have tested.

Multiplayer?

No — single-player integrated server.

Version

Other. (probably unsupported): 1.21.1-0.8.0a, installed AdvancedPeripherals-1.21.1-0.8.0a.jar. The issue form no longer lists this release. The newer 0.8.1a and 0.8 development source were inspected as noted above, not live-tested.

Minecraft, Forge and maybe other related mods versions

  • Minecraft 1.21.1
  • NeoForge 21.1.249
  • CC: Tweaked 1.120.2, confirmed by live _HOST: ComputerCraft 1.120.2 (Minecraft 1.21.1)
  • Ars Controle 1.21.1-1.6.15 (physical front block)
  • All the Mods 10 installation; not yet reproduced in a clean minimal pack
  • For transparency, the pack directory contains both CC 1.113.1 and 1.120.2 JARs; the live runtime identifies 1.120.2. No mods/configs were changed to obtain this result.

Screenshots or Videos

None. Normalized output from the actual non-destructive diagnostic is included above.

Crashlog/log

No JVM crash was observed. The original dig test's last checkpoint was its first dig intent, followed by loss of turtle heartbeat; on return, the supervisor reported the test interrupted and did not rerun it. The subsequent look-only diagnostic completed and failed its safety check with UNSAFE: core ray hits a turtle instead of the front linkage, lookCalls=1, hitsTurtle=true, and unchanged inventory/fuel/selection/front block. Private filesystem paths and unrelated full modpack logs are omitted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions