mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Adjust API methods
This commit is contained in:
1 parent
e2d9e08505
commit
fcb7324f63
1 file changed
+7
-8
@@ -21,12 +21,11 @@ import java.util.logging.Level;
|
|||||||
public class HuskHomesAPI {
|
public class HuskHomesAPI {
|
||||||
|
|
||||||
private static final HuskHomes huskHomes = HuskHomes.getInstance();
|
private static final HuskHomes huskHomes = HuskHomes.getInstance();
|
||||||
private static Connection getConnection() {
|
|
||||||
return HuskHomes.getConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static HuskHomesAPI instance;
|
private static HuskHomesAPI instance;
|
||||||
|
|
||||||
|
private HuskHomesAPI() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the HuskHomes API
|
* Get the HuskHomes API
|
||||||
* @return instance of the HuskHomes API
|
* @return instance of the HuskHomes API
|
||||||
@@ -58,7 +57,7 @@ public class HuskHomesAPI {
|
|||||||
*/
|
*/
|
||||||
public Home getHome(String ownerUsername, String homeName) {
|
public Home getHome(String ownerUsername, String homeName) {
|
||||||
try {
|
try {
|
||||||
return DataManager.getHome(ownerUsername, homeName, getConnection());
|
return DataManager.getHome(ownerUsername, homeName, HuskHomes.getConnection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
||||||
return null;
|
return null;
|
||||||
@@ -73,7 +72,7 @@ public class HuskHomesAPI {
|
|||||||
*/
|
*/
|
||||||
public Warp getWarp(String warpName) {
|
public Warp getWarp(String warpName) {
|
||||||
try {
|
try {
|
||||||
return DataManager.getWarp(warpName, getConnection());
|
return DataManager.getWarp(warpName, HuskHomes.getConnection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
||||||
return null;
|
return null;
|
||||||
@@ -98,7 +97,7 @@ public class HuskHomesAPI {
|
|||||||
*/
|
*/
|
||||||
public List<Home> getHomes(String ownerUsername) {
|
public List<Home> getHomes(String ownerUsername) {
|
||||||
try {
|
try {
|
||||||
return DataManager.getPlayerHomes(ownerUsername, getConnection());
|
return DataManager.getPlayerHomes(ownerUsername, HuskHomes.getConnection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
||||||
return null;
|
return null;
|
||||||
@@ -140,7 +139,7 @@ public class HuskHomesAPI {
|
|||||||
*/
|
*/
|
||||||
public List<Home> getPublicHomes() {
|
public List<Home> getPublicHomes() {
|
||||||
try {
|
try {
|
||||||
return DataManager.getPublicHomes(getConnection());
|
return DataManager.getPublicHomes(HuskHomes.getConnection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
||||||
return null;
|
return null;
|
||||||
@@ -163,7 +162,7 @@ public class HuskHomesAPI {
|
|||||||
*/
|
*/
|
||||||
public List<Warp> getWarps() {
|
public List<Warp> getWarps() {
|
||||||
try {
|
try {
|
||||||
return DataManager.getWarps(getConnection());
|
return DataManager.getWarps(HuskHomes.getConnection());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
huskHomes.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving data for API access", e);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in new issue
Block a user