Skip to content

Commit

Permalink
Update PlayerConnectionListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev7ex committed Sep 9, 2024
1 parent ded5fcf commit 5dbae17
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import com.dev7ex.common.collect.map.ParsedMap;
import com.dev7ex.multiworld.api.bukkit.MultiWorldBukkitApi;
import com.dev7ex.multiworld.api.bukkit.event.MultiWorldListener;
import com.dev7ex.multiworld.api.bukkit.event.user.WorldUserLoginEvent;
import com.dev7ex.multiworld.api.bukkit.event.user.WorldUserLogoutEvent;
import com.dev7ex.multiworld.api.bukkit.user.BukkitWorldUser;
import com.dev7ex.multiworld.api.user.WorldUserConfiguration;
import com.dev7ex.multiworld.api.user.WorldUserProperty;
import com.dev7ex.multiworld.user.User;
import com.dev7ex.multiworld.user.UserConfiguration;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -51,6 +54,8 @@ public void handlePlayerLogin(final PlayerLoginEvent event) {
user.setConfiguration(userConfiguration);

super.getUserProvider().registerUser(user);

Bukkit.getPluginManager().callEvent(new WorldUserLoginEvent(user));
}

/**
Expand All @@ -77,6 +82,8 @@ public void handlePlayerQuit(final PlayerQuitEvent event) {

super.getUserProvider().saveUser(user, WorldUserProperty.LAST_LOCATION);
super.getUserProvider().unregisterUser(player.getUniqueId());

Bukkit.getPluginManager().callEvent(new WorldUserLogoutEvent(user));
}

}

0 comments on commit 5dbae17

Please sign in to comment.