mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
Paper Utils
This commit is contained in:
parent
15081a5912
commit
258a2ce7b8
@ -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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user