!Made important method private to avoid confusion

This commit is contained in:
Indyuce 2019-12-22 15:31:43 +01:00
parent 51e2bdea06
commit 280b48b857
3 changed files with 4 additions and 4 deletions

View File

@ -305,7 +305,7 @@ public class MMOCore extends JavaPlugin {
* the player datas can't recognize what profess the player has and
* professes will be lost
*/
Bukkit.getOnlinePlayers().forEach(player -> PlayerData.setup(player).setPlayer(player));
Bukkit.getOnlinePlayers().forEach(player -> PlayerData.setup(player));
// commands
try {

View File

@ -232,7 +232,7 @@ public class PlayerData {
public static PlayerData setup(Player player) {
if (!playerData.containsKey(player.getUniqueId()))
playerData.put(player.getUniqueId(), new PlayerData(player).load(new ConfigFile(player).getConfig()));
return get(player);
return get(player).setPlayer(player);
}
public static boolean isLoaded(UUID uuid) {
@ -281,7 +281,7 @@ public class PlayerData {
* END OF EXPERIMENTAL CODE
*/
public PlayerData setPlayer(Player player) {
private PlayerData setPlayer(Player player) {
this.player = player;
this.lastLogin = System.currentTimeMillis();
return this;

View File

@ -32,7 +32,7 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void a(PlayerJoinEvent event) {
Player player = event.getPlayer();
PlayerData pd = PlayerData.setup(player).setPlayer(player); pd.getStats().updateAll();
PlayerData.setup(player).getStats().updateAll();
}
/*