mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2026-01-06 15:42:00 +00:00
1.20.3 support
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package net.momirealms.customnameplates.common.util;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ThrowableFunction<T, R> extends Function<T, R> {
|
||||
|
||||
@Override
|
||||
default R apply(T t) {
|
||||
try {
|
||||
return applyWithException(t);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
R applyWithException(T t) throws Exception;
|
||||
}
|
||||
Reference in New Issue
Block a user