9
0
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:
XiaoMoMi
2024-11-02 20:12:38 +08:00
parent 7d6fba25e6
commit f5d2d6a0bc
17 changed files with 225 additions and 42 deletions

View File

@@ -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;
}