mirror of
https://github.com/5vl/DoubleJump.git
synced 2025-05-24 06:46:59 +00:00
21 lines
742 B
Java
21 lines
742 B
Java
package me.fivevl.doublejump.events;
|
|
|
|
import me.fivevl.doublejump.Main;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.player.PlayerJoinEvent;
|
|
import javax.sql.rowset.CachedRowSet;
|
|
import java.sql.SQLException;
|
|
|
|
public class OnJoin implements Listener {
|
|
@EventHandler
|
|
public void onJoin(PlayerJoinEvent e) throws SQLException {
|
|
Player p = e.getPlayer();
|
|
CachedRowSet rs = Main.getMySQL().query("SELECT * FROM `settings` WHERE `uuid` = '" + p.getUniqueId() + "'");
|
|
if (!rs.next()) {
|
|
Main.getMySQL().execute("INSERT INTO `settings` (`uuid`, `strength`) VALUES ('" + p.getUniqueId() + "', default)");
|
|
}
|
|
}
|
|
}
|