Hex Casting

Hex Casting

6M Downloads

[1.20] Bound cleric circle doesn't have ambit at bound player

Robotgiggle opened this issue ยท 9 comments

commented

Version used: 0.11.1, build 609

In previous versions, a bound cleric circle would always have access to the bound player along with a small radius around them. In 1.20, this does not seem to be the case. A bound cleric circle that attempts to use Mind's Reflection will fail unless the bound player is standing in the circle.

2024-01-23_10 34 45

commented

whats the exact hexcasting version. (also TIL minds reflection checks ambit... shouldn't self always be in ambit though???)

commented

huh... at some point it stopped checking i player in range

    @Override
    public boolean isVecInRangeEnvironment(Vec3 vec) {
        var caster = this.execState.getCaster(this.world);
        if (caster != null) {
            var sentinel = HexAPI.instance().getSentinel(caster);
            if (sentinel != null
                && sentinel.extendsRange()
                && caster.level().dimension() == sentinel.dimension()
                && vec.distanceToSqr(sentinel.position()) <= SENTINEL_RADIUS * SENTINEL_RADIUS
            ) {
                return true;
            }
        }

        return this.execState.bounds.contains(vec);
    }

it has ambit on sentinal but not player.

commented

Added exact version (although it seems like you may have already found the issue)

commented

I tried to look through the entire history of circle-based casting environment
and it appears that it has NEVER had ambit on player

commented

I tested this a little while ago in the same build and I found that it worked in the Fabric release for whatever reason, but now that I'm trying it again, it works in neither version(Fabric nor Forge). So bizarre, but it seems you found the root of the issue

Maybe I had accidentally been in range of a sentinel, oops

commented

somewhere in the transition from CastingContext to CastingEnvironment the circles lost ambit on the bound player.
gonna make a quick PR for this

commented

(also this brought up another question. why does OpGetCaster check ambit??)

commented

oh wait this is duplicate of #561

commented

why does OpGetCaster check ambit

wisps don't have ambit around the player that made them (only around themselves), so they shouldn't be able to get a reference to the summoner unless they're nearby
oddly, it seems like wisps can actually use Mind's Reflection even if the caster is nowhere nearby. i wonder how that works?