mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +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
@@ -30,9 +30,8 @@ public class HomeCommand extends CommandBase {
|
||||
|
||||
@Override
|
||||
protected void onCommand(Player p, Command command, String label, String[] args) {
|
||||
Connection connection = HuskHomes.getConnection();
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
try(Connection connection = HuskHomes.getConnection()) {
|
||||
if (args.length == 1) {
|
||||
String homeArgument = args[0];
|
||||
if (RegexUtil.OWNER_NAME_PATTERN.matcher(homeArgument).matches()) {
|
||||
@@ -66,9 +65,8 @@ public class HomeCommand extends CommandBase {
|
||||
// This method updates a player's home cache.
|
||||
public static void updatePlayerHomeCache(Player p) {
|
||||
UUID uuid = p.getUniqueId();
|
||||
Connection connection = HuskHomes.getConnection();
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
try(Connection connection = HuskHomes.getConnection()) {
|
||||
List<Home> playerHomes = DataManager.getPlayerHomes(p.getName(), connection);
|
||||
List<String> homeNames = new ArrayList<>();
|
||||
for (Home home : playerHomes) {
|
||||
|
||||
Reference in new issue
Block a user