Paper Utils

This commit is contained in:
Aikar 2019-02-23 11:26:21 -05:00
parent 15081a5912
commit 258a2ce7b8

View File

@ -0,0 +1,19 @@
package com.destroystokyo.paper.util;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
@NullMarked
public final class SneakyThrow {
public static void sneaky(final Throwable exception) {
SneakyThrow.throwSneaky(exception);
}
@SuppressWarnings("unchecked")
private static <T extends Throwable> void throwSneaky(final Throwable exception) throws T {
throw (T) exception;
}
}