mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Restructure connection interfacing system
This commit is contained in:
1 parent
894b50ad0d
commit
7ef9159daf
33 files changed
+200
-256
No files matched your search
@@ -25,11 +25,11 @@ public class BlueMap extends Map {
|
||||
private static String publicHomeMarkerImageAddress;
|
||||
|
||||
private void executeQueuedOperations() {
|
||||
try {
|
||||
try (Connection connection = HuskHomes.getConnection()) {
|
||||
for (String warpName : queuedWarps.keySet()) {
|
||||
boolean add = queuedWarps.get(warpName);
|
||||
if (add) {
|
||||
Warp warpToAdd = DataManager.getWarp(warpName, HuskHomes.getConnection());
|
||||
Warp warpToAdd = DataManager.getWarp(warpName, connection);
|
||||
if (warpToAdd != null) {
|
||||
addWarpMarker(warpToAdd);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class BlueMap extends Map {
|
||||
String ownerName = fullHomeName.split("\\.")[0];
|
||||
String homeName = fullHomeName.split("\\.")[1];
|
||||
if (add) {
|
||||
Home homeToAdd = DataManager.getHome(ownerName, homeName, HuskHomes.getConnection());
|
||||
Home homeToAdd = DataManager.getHome(ownerName, homeName, connection);
|
||||
if (homeToAdd != null) {
|
||||
addPublicHomeMarker(homeToAdd);
|
||||
}
|
||||
@@ -156,8 +156,7 @@ public class BlueMap extends Map {
|
||||
@Override
|
||||
public void initialize() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
Connection connection = HuskHomes.getConnection();
|
||||
try {
|
||||
try (Connection connection = HuskHomes.getConnection()) {
|
||||
for (Home home : DataManager.getPublicHomes(connection)) {
|
||||
if (!HuskHomes.getSettings().doBungee() || home.getServer().equals(HuskHomes.getSettings().getServerID())) {
|
||||
addPublicHomeMarker(home);
|
||||
|
||||
Reference in new issue
Block a user