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

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

Closed
cambates99 opened this issue Apr 18, 2023 · 2 comments

Comments

@cambates99
Copy link

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

Kamefrede added a commit that referenced this issue Nov 7, 2023
@Kamefrede
Copy link
Contributor

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

@cambates99
Copy link
Author

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants