mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 22:07:50 +01:00
Make playernames case insensitive when used as a key
This commit is contained in:
parent
b5390cbd91
commit
015f369e0a
@ -33,11 +33,11 @@ public class PlayerManager {
|
|||||||
*/
|
*/
|
||||||
public NoCheatPlayer getPlayer(Player player) {
|
public NoCheatPlayer getPlayer(Player player) {
|
||||||
|
|
||||||
NoCheatPlayerImpl p = this.players.get(player.getName());
|
NoCheatPlayerImpl p = this.players.get(player.getName().toLowerCase());
|
||||||
|
|
||||||
if(p == null) {
|
if(p == null) {
|
||||||
p = new NoCheatPlayerImpl(player, plugin);
|
p = new NoCheatPlayerImpl(player, plugin);
|
||||||
this.players.put(player.getName(), p);
|
this.players.put(player.getName().toLowerCase(), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setLastUsedTime(System.currentTimeMillis());
|
p.setLastUsedTime(System.currentTimeMillis());
|
||||||
@ -57,7 +57,7 @@ public class PlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearCriticalData(String playerName) {
|
public void clearCriticalData(String playerName) {
|
||||||
NoCheatPlayer p = this.players.get(playerName);
|
NoCheatPlayer p = this.players.get(playerName.toLowerCase());
|
||||||
if(p != null) {
|
if(p != null) {
|
||||||
p.getData().clearCriticalData();
|
p.getData().clearCriticalData();
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ public class PlayerManager {
|
|||||||
|
|
||||||
public void getPlayerData(String playerName, Map<String, Object> map) {
|
public void getPlayerData(String playerName, Map<String, Object> map) {
|
||||||
|
|
||||||
NoCheatPlayer player = this.players.get(playerName);
|
NoCheatPlayer player = this.players.get(playerName.toLowerCase());
|
||||||
|
|
||||||
if(player != null) {
|
if(player != null) {
|
||||||
BaseData data = player.getData();
|
BaseData data = player.getData();
|
||||||
|
Loading…
Reference in New Issue
Block a user