Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity List Seems to be random #664

Closed
quicktinker opened this issue Feb 7, 2021 · 2 comments
Closed

Entity List Seems to be random #664

quicktinker opened this issue Feb 7, 2021 · 2 comments
Labels
partially invalid This issue is partially not a problem, or otherwise is not entirely an issue as stated. question Something unclear about the mod. solved? Possibly solved, but we aren't quite sure. wontfix

Comments

@quicktinker
Copy link

quicktinker commented Feb 7, 2021

Version Information

Forge version:35.1.37
Psi version:1.16-91

Further Information

Link to crash log: (please use a paste site such as gist, do not attach the .txt or paste the log inline)
Steps to reproduce:

  1. First step: Created a spell that adds me and other players nearby to a list
  2. Second step: concatenate the two lists
  3. Third step: reading out the combined list shows the entities in an unexpected or incorrect order

What I expected to happen:
When I used Add to list or Concatenate list I expected it to add entities in the order the lists were in previously
What happened instead:
The entity list positions were randomized or sorted into an alphabetical order of some sort instead of retaining their individual list orders.

I have attached an example image of the readout from a similar code below where [1] is the combined list. Note that the caster is in the middle of that list despite being added to a list of nearby players. this should have added the player to the start or the end of the list, not the middle.

Code being expermented with below;
{modsRequired:[{modVersion:"1.16-91",modName:"psi"}],spellName:"Regeneration",uuidMost:-1089086145862087781L,validSpell:1b,spellList:[{data:{key:"psi:selector_sneak_status"},x:2,y:3},{data:{params:{_number2:2,_number3:0,_number1:1},key:"psi:operator_subtract"},x:2,y:4},{data:{key:"psi:constant_number",constantValue:"1"},x:2,y:5},{data:{params:{_target:2},key:"psi:operator_entity_position"},x:2,y:6},{data:{key:"psi:selector_caster"},x:2,y:7},{data:{key:"psi:constant_number",constantValue:"5"},x:3,y:3},{data:{params:{_target:3},key:"psi:operator_absolute"},x:3,y:4},{data:{key:"psi:selector_caster"},x:3,y:5},{data:{params:{_ray:2,_max:0,_position:3},key:"psi:operator_vector_raycast"},x:3,y:6},{data:{params:{_target:3},key:"psi:operator_entity_look"},x:3,y:7},{data:{params:{_power:4,_time:3,_target:2},key:"psi:trick_regeneration"},x:4,y:3},{data:{params:{_list:2,_number:3},key:"psi:operator_list_index"},x:4,y:4},{data:{params:{_list:2,_target:3},key:"psi:operator_list_add"},x:4,y:5},{data:{params:{_position:3,_radius:2},key:"psi:selector_nearby_players"},x:4,y:6},{data:{key:"psi:constant_number",constantValue:"3"},x:4,y:7},{data:{key:"psi:constant_number",constantValue:"2"},x:5,y:3},{data:{params:{_power:2,_time:1,_target:3},key:"psi:trick_resistance"},x:5,y:4},{data:{key:"psi:constant_number",constantValue:"1"},x:5,y:5}],uuidLeast:-9221320899705922436L}

image

@Alwinfy
Copy link
Member

Alwinfy commented Mar 19, 2021

It hasn't been properly documented (sorry about that, it'll happen Soon™), but Entity "List" is a bit of a misnomer.
Lists don't actually stay in order when you merge them; it is only guaranteed that the same list of Entities keeps the same ordering for that list of Entities. When making a new list, all bets are off.

@Kamefrede Kamefrede added partially invalid This issue is partially not a problem, or otherwise is not entirely an issue as stated. question Something unclear about the mod. solved? Possibly solved, but we aren't quite sure. wontfix labels Mar 19, 2021
@Kamefrede Kamefrede pinned this issue Mar 19, 2021
@Kamefrede
Copy link
Contributor

Pinned for now until the behavior gets properly documented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
partially invalid This issue is partially not a problem, or otherwise is not entirely an issue as stated. question Something unclear about the mod. solved? Possibly solved, but we aren't quite sure. wontfix
Projects
None yet
Development

No branches or pull requests

3 participants