mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Added cross-server teleportation handling
This commit is contained in:
1 parent
2aeab951c6
commit
879293237f
18 files changed
+823
-82
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package me.william278.huskhomes2.Objects;
|
||||
|
||||
import me.william278.huskhomes2.Main;
|
||||
import me.william278.huskhomes2.dataManager;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SetHomeConditions {
|
||||
|
||||
boolean conditionsMet;
|
||||
String conditionsNotMetReason;
|
||||
|
||||
public SetHomeConditions(Player player, String homeName) {
|
||||
conditionsMet = false;
|
||||
if (dataManager.getPlayerHomeCount(player) > (Main.settings.getMaximumHomes()-1)) {
|
||||
conditionsNotMetReason = "error_set_home_maximum_homes";
|
||||
return;
|
||||
}
|
||||
if (dataManager.homeExists(player, homeName)) {
|
||||
conditionsNotMetReason = "error_set_home_name_taken";
|
||||
return;
|
||||
}
|
||||
conditionsMet = true;
|
||||
}
|
||||
|
||||
public boolean areConditionsMet() {
|
||||
return conditionsMet;
|
||||
}
|
||||
|
||||
public String getConditionsNotMetReason() {
|
||||
return conditionsNotMetReason;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user