Psi

Psi

45M Downloads

Break Block Sequence always breaking Max blocks even when vector is shorter than max.

MindCaged opened this issue ยท 1 comments

commented

Minecraft 1.16.4
Psi 1.16-91

Okay, I've been trying to fix a spell, and I noticed that even when I'm providing a vector of <2,0,0> with a max block limit of 8 blocks, it's breaking the whole 8 blocks.

Here's a test spell. It's uses vector construct to create a length 2 vector and yet Break Block Sequence is breaking 8 blocks. Is this intended behavior that it always breaks the Max length amount?

{modsRequired:[{modVersion:"1.16-91",modName:"psi"}],spellName:"Break Block Sequence",uuidMost:-6016450243426630270L,validSpell:1b,spellList:[{data:{key:"psi:constant_number",constantValue:"2"},x:3,y:2},{data:{params:{_x:3,_y:0,_z:0},key:"psi:operator_vector_construct"},x:4,y:2},{data:{key:"psi:constant_number",constantValue:"8"},x:5,y:1},{data:{params:{_max:1,_target:3,_position:4},key:"psi:trick_break_in_sequence"},x:5,y:2},{data:{params:{_target:4},key:"psi:operator_entity_position"},x:6,y:1},{data:{params:{_ray:4,_max:0,_position:1},key:"psi:operator_vector_raycast"},x:6,y:2},{data:{key:"psi:selector_caster"},x:7,y:1},{data:{params:{_target:1},key:"psi:operator_entity_look"},x:7,y:2}],uuidLeast:-5037783857343383196L}

Edit: Okay, looking at the code it looks like in v1.16-85 there's a line saying:

  • Fixed new sequence tricks not handling 0 blocks properly (Kamefrede)

This appears to mean they rewrote sequence tricks to use Target /only/ for direction dropping the distance element and use Max to specify length, which breaks backwards compatibility.

Suggestions:

  1. Restore the original behavior so old spells still work.
    or
  2. Add a warning whenever importing a spell from an older version that warns you that the behavior of Sequence tricks has changed and the spell may be broken(probably is unless you were trying to break/place/conjure/etc a fixed number of blocks)
    2b. Rename the arguments from Position, Target, Max to Position, Direction, Length/Blocks/etc.

If we're keeping the new behavior it'll be necessary to use a Constant Wrapper to specify the number of blocks to operate on.
To be fair I see certain advantages with specifying the length with a number instead of using vector normalize/multiply/sum/etc to manipulate the distance.

commented

A warning will be added once I push out a release :)
Pinning this just in case