0% found this document useful (0 votes)
13 views1 page

GetSklep Player Join Listener

The PlayerJoinListener class handles player join and quit events in a Bukkit plugin. Upon a player joining, it asynchronously loads user data from a SQLite database, and upon quitting, it updates the user data and removes their buy data and spent points. The class is registered as an event listener in the plugin's constructor.

Uploaded by

spike.xxx1111
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

GetSklep Player Join Listener

The PlayerJoinListener class handles player join and quit events in a Bukkit plugin. Upon a player joining, it asynchronously loads user data from a SQLite database, and upon quitting, it updates the user data and removes their buy data and spent points. The class is registered as an event listener in the plugin's constructor.

Uploaded by

spike.xxx1111
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

listeners;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class PlayerJoinListener implements Listener {

private final GetSklep plugin;

public PlayerJoinListener(GetSklep plugin)


{
[Link] = plugin;
[Link]().getPluginManager().registerEvents(this, plugin);
}

@EventHandler
public void onJoin(PlayerJoinEvent event)
{
Player player = [Link]();
new BukkitRunnable() {
@Override
public void run() {
[Link]().loadUser([Link]());
}
}.runTaskAsynchronously(plugin);
}
@EventHandler
public void onQuit(PlayerQuitEvent event)
{
Player player = [Link]();
[Link]().getUserBuyData().remove([Link]());
new BukkitRunnable() {
@Override
public void run() {
[Link]().updateUser(player);
[Link]().remove([Link]());
}
}.runTaskAsynchronously(plugin);
}
}

You might also like