Paper Utils
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user