New player list caching system, further refinements and fixes

This commit is contained in:
William committed 2023-03-21 12:49:36 +00:00
1 parent 054811676d
commit 93dd15007a
59 files changed
+445 -317

No files matched your search

@@ -11,8 +11,9 @@ public interface TaskRunner {
<T> CompletableFuture<T> supplyAsync(@NotNull Supplier<T> supplier);
int runSync(@NotNull Runnable runnable);
int runAsyncRepeating(@NotNull Runnable runnable, long delay);
int runLater(@NotNull Runnable runnable, long delay);
void cancelTask(int taskId);
void cancelAllTasks();
@NotNull
HuskHomes getPlugin();
}
@@ -0,0 +1,19 @@
package net.william278.huskhomes.util;
import java.util.function.Consumer;
@FunctionalInterface
public interface ThrowingConsumer<T> extends Consumer<T> {
@Override
default void accept(final T elem) {
try {
acceptThrows(elem);
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
void acceptThrows(T elem) throws Exception;
}
@@ -19,7 +19,7 @@ public class ValidationException extends IllegalArgumentException {
.getLocale(other ? "error_home_invalid_other" : "error_home_invalid", args)
.ifPresent(viewer::sendMessage);
case NAME_TAKEN -> plugin.getLocales()
.getLocale("error_home_name_taken", args)
.getLocale("error_home_name_taken")
.ifPresent(viewer::sendMessage);
case NAME_INVALID -> plugin.getLocales()
.getLocale("error_home_name_characters", args)