Skip to content

Commit

Permalink
Fix IllegalArgumentException; ensure JDBC driver is present at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Jun 11, 2021
1 parent df429ee commit 3b01cc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import me.william278.huskhomes2.teleport.points.RandomPoint;
import me.william278.huskhomes2.teleport.points.TeleportationPoint;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.sql.Connection;
Expand Down Expand Up @@ -46,8 +47,9 @@ public static void teleportPlayer(Player p) {
if (!HuskHomes.getSettings().doBungee() || server.equals(HuskHomes.getSettings().getServerID())) {
DataManager.setPlayerTeleporting(p, false, connection);
DataManager.deletePlayerDestination(p.getName(), connection);
Location targetLocation = teleportationPoint.getLocation();
Bukkit.getScheduler().runTask(plugin, () -> {
PaperLib.teleportAsync(p, teleportationPoint.getLocation());
PaperLib.teleportAsync(p, targetLocation);
p.playSound(p.getLocation(), HuskHomes.getSettings().getTeleportationCompleteSound(), 1, 1);
MessageManager.sendMessage(p, "teleporting_complete");
});
Expand All @@ -57,9 +59,9 @@ public static void teleportPlayer(Player p) {
PluginMessage.sendPlayer(p, server);
}
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred!", e);
} catch (Exception e) {
} catch (SQLException sqlException) {
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred!", sqlException);
} catch (IllegalArgumentException illegalArgumentException) {
MessageManager.sendMessage(p, "error_invalid_on_arrival");
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ commands:
huskhomes:
description: Plugin information & reload configs.
usage: /huskhomes <about/update/reload/migrate>

libraries:
- mysql:mysql-connector-java:8.0.25
permissions:
huskhomes.*:
description: Grants all HuskHomes permissions
Expand Down

0 comments on commit 3b01cc1

Please sign in to comment.