mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 06:28:49 +00:00
Re-added many HuskHomes commands
This commit is contained in:
1 parent
d20baa41d1
commit
1b8254d46a
34 files changed
+1485
-47
No files matched your search
@@ -252,6 +252,34 @@ public abstract class Database {
|
||||
}
|
||||
}
|
||||
|
||||
// Update the location of a home
|
||||
public void setHomePrivacy(String homeName, int ownerID, boolean isPublic) {
|
||||
Connection conn = null;
|
||||
PreparedStatement ps = null;
|
||||
|
||||
try {
|
||||
conn = getSQLConnection();
|
||||
|
||||
// Set the home location ID to the new teleport point for the given home
|
||||
ps = conn.prepareStatement("UPDATE huskhomes_home_data SET `public`=? WHERE `name`=? AND `player_id`=?;");
|
||||
ps.setBoolean(1, isPublic);
|
||||
ps.setString(2, homeName);
|
||||
ps.setInt(3, ownerID);
|
||||
ps.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||
} finally {
|
||||
try {
|
||||
if (ps != null)
|
||||
ps.close();
|
||||
if (conn != null)
|
||||
conn.close();
|
||||
} catch (SQLException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the location of a home
|
||||
public void setHomeTeleportPoint(String homeName, int ownerID, TeleportationPoint point) {
|
||||
Connection conn = null;
|
||||
|
||||
Reference in new issue
Block a user