#OfflinePlayer instances not matching for same player
1 messages · Page 1 of 1 (latest)
Here's some relevent code
if (target == player) {
// same player response
return;
}
Resident targetR = town.getResident(target);
if (targetR == null) {
// not a resident response
return;
}```
Even though I'm typing the player's name EXACTLY during testing, the Bukkit.getOfflinePlayer() instance is still different to the stored instance
I'm guessing that this is just how Bukkit handles it, so is there any way around this?
Have you tried .equals
Oh ffs hang on
Yep, that'll do it. Thanks 😂
#Object.equals() compares the value as opposed to comparing references right?
It uses the equals method