mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Almost completed SQL handling
This commit is contained in:
1 parent
b95629a986
commit
cf1ffdb611
9 files changed
+488
-89
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package me.william278.huskhomes2.Objects;
|
||||
|
||||
import me.william278.huskhomes2.Main;
|
||||
import me.william278.huskhomes2.dataManager;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class HomeConditionsMet {
|
||||
|
||||
boolean conditionsMet;
|
||||
String conditionsNotMetReason;
|
||||
|
||||
public HomeConditionsMet (Player player) {
|
||||
if (dataManager.getPlayerHomeCount(player) > (Main.settings.getMaximumHomes()-1)) {
|
||||
conditionsMet = false;
|
||||
conditionsNotMetReason = "error_set_home_maximum_homes";
|
||||
return;
|
||||
}
|
||||
conditionsMet = true;
|
||||
}
|
||||
|
||||
public boolean areConditionsMet() {
|
||||
return conditionsMet;
|
||||
}
|
||||
|
||||
public String getConditionsNotMetReason() {
|
||||
return conditionsNotMetReason;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ public class Settings {
|
||||
String homesTable;
|
||||
String warpsTable;
|
||||
|
||||
int maximumHomes;
|
||||
|
||||
boolean doBungee;
|
||||
|
||||
private void setSettings(FileConfiguration configFile) {
|
||||
@@ -28,6 +30,8 @@ public class Settings {
|
||||
this.homesTable = configFile.getString("data_storage_options.table_names.home_data");
|
||||
this.warpsTable = configFile.getString("data_storage_options.table_names.warp_data");
|
||||
|
||||
this.maximumHomes = configFile.getInt("limits.max_sethomes");
|
||||
|
||||
}
|
||||
|
||||
public Settings(FileConfiguration configFile) {
|
||||
@@ -69,4 +73,6 @@ public class Settings {
|
||||
public String getWarpsTable() {
|
||||
return warpsTable;
|
||||
}
|
||||
|
||||
public int getMaximumHomes() { return maximumHomes; }
|
||||
}
|
||||
Reference in new issue
Block a user