Restructure connection interfacing system

This commit is contained in:
William committed 2021-10-02 23:07:45 +01:00
1 parent 894b50ad0d
commit 7ef9159daf
33 files changed
+200 -256

No files matched your search

@@ -19,9 +19,8 @@ public class TpHereCommand extends CommandBase {
protected void onCommand(Player p, Command command, String label, String[] args) {
if (args.length == 1) {
String targetPlayer = args[0];
Connection connection = HuskHomes.getConnection();
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {
try (Connection connection = HuskHomes.getConnection()) {
TeleportManager.teleportHere(p, targetPlayer, connection);
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred using /tphere");