mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Further refactoring, move away from using future thread pool
This commit is contained in:
1 parent
4c90e5498c
commit
39e0b25d46
56 files changed
+737
-1713
No files matched your search
@@ -40,7 +40,7 @@ public abstract class EconomyHook extends PluginHook {
|
||||
/**
|
||||
* Identifies actions that incur an economic cost if economy is enabled
|
||||
*/
|
||||
public enum EconomyAction {
|
||||
public enum Action {
|
||||
ADDITIONAL_HOME_SLOT(100.00, "economy_action_additional_home_slot"),
|
||||
MAKE_HOME_PUBLIC(50.00, "economy_action_make_home_public"),
|
||||
RANDOM_TELEPORT(25.00, "economy_action_random_teleport"),
|
||||
@@ -50,7 +50,7 @@ public abstract class EconomyHook extends PluginHook {
|
||||
@NotNull
|
||||
public final String confirmationLocaleId;
|
||||
|
||||
EconomyAction(final double defaultCost, @NotNull String confirmationLocaleId) {
|
||||
Action(final double defaultCost, @NotNull String confirmationLocaleId) {
|
||||
this.defaultCost = defaultCost;
|
||||
this.confirmationLocaleId = confirmationLocaleId;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.djrapitops.plan.extension.annotation.*;
|
||||
import com.djrapitops.plan.extension.icon.Color;
|
||||
import com.djrapitops.plan.extension.icon.Family;
|
||||
import net.william278.huskhomes.database.Database;
|
||||
import net.william278.huskhomes.position.Home;
|
||||
import net.william278.huskhomes.user.UserData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -77,8 +78,8 @@ public class PlanDataExtension implements DataExtension {
|
||||
@Conditional("hasData")
|
||||
public long getPublicHomeCount(@NotNull UUID uuid) {
|
||||
return database.getUserData(uuid)
|
||||
.map(userData -> database.getHomes(userData.user())
|
||||
.stream().filter(home -> home.isPublic()).count())
|
||||
.map(userData -> database.getHomes(userData.user()).stream()
|
||||
.filter(Home::isPublic).count())
|
||||
.orElse(0L);
|
||||
}
|
||||
|
||||
@@ -123,7 +124,7 @@ public class PlanDataExtension implements DataExtension {
|
||||
.map(userData -> database.getOfflinePosition(userData.user())
|
||||
.map(position -> "x: " + (int) position.getX() + ", y: " + (int) position.getY() + ", z: " + (int) position.getZ()
|
||||
+ " (" + position.getWorld().getName() +
|
||||
((crossServer) ? "/" + position.getServer().getName() + ")" : ")"))
|
||||
((crossServer) ? "/" + position.getServer() + ")" : ")"))
|
||||
.orElse(UNKNOWN_STRING))
|
||||
.orElse(UNKNOWN_STRING);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user