Psi

Psi

45M Downloads

[REQUEST/BUG?] Sort the Selector Lists in Order of Ascending Entity Creation Number

cambates99 opened this issue ยท 2 comments

commented

Version Information

Forge version: 40.2.1
Psi version: 2.0.0

Further Information

The issue I'm running into is that the selector lists will index the entities inside the targeted radius pseudo-randomly. This makes it very challenging to use the selector indexed element to distinguish between old/new entities populating the list.

Similar Ticket
I read through ticket #664 and think this issue is entirely different. This has nothing to do with concatenating lists, so I thought I'd hear your thoughts on the proposed change.

Proposed Change
I've read through some of the list population code under public abstract class PieceSelectorNearby extends PieceSelector and propose you add under Line 71 something close to list.sort(Comparator.comparingInt(Entity::getNumber).

I'm unsure how you're storing the entities generation number (could be an int or string), but that number is universal & unique for every entity created. I'm talking about the number seen here: https://imgur.com/4UzWvyz

commented

Changed the internal list ordering algorithm to use the entity's id.
Let's see how this pans out.

commented

Awesome! I'm gonna mess around with it here in a few days. I came up with a really interesting spell and hopefully I can get it working now. :)