What's the best way to code this?

Status
This thread has been locked.

Kuzni

If you signed up after 2016 don't diss me thx
Supreme
Feedback score
12
Posts
1,688
Reactions
950
Resources
0
Hello boys and girls,

I want to talk about efficiency/ease.

I understand that you're supposed to do arraylists with UUIDs to store players, you know, to prevent memory leaks and stuff. However is it necessary when coding an event plugin? If they log out, they're removed from the array, plus, they can't change their IGN mid game, so the only way they're stored as that player, is until the event is over or until they log out, is that an issue compared to storing with UUID?
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Kuzni

If you signed up after 2016 don't diss me thx
Supreme
Feedback score
12
Posts
1,688
Reactions
950
Resources
0
I could barely understand what you were asking, but if you were asking if you should store a UUID over a Player the answer is UUID. If it's just a temporary game mode, just store the player's name instead. Once they are removed from the list or set you don't needd to worry.

Basically exactly what I was asking, thanks <3
 

Kieraaaan

Plugin Developer
Premium
Feedback score
7
Posts
463
Reactions
222
Resources
0
Does it even make a difference (efficiency wise). Either way, I would just store UUIDs; all you do is change Player#getName() to Player#getUniqueId().
 

Kuzni

If you signed up after 2016 don't diss me thx
Supreme
Feedback score
12
Posts
1,688
Reactions
950
Resources
0
Thanks guys, closing the thread. <3
 
Status
This thread has been locked.
Top