mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 06:28:49 +00:00
New player list caching system, further refinements and fixes
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user