mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 04:02:50 +01:00
57dd397155
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
31 lines
890 B
Diff
31 lines
890 B
Diff
From 9941a3d6ebbd8e1c89d8cddc53c81a9e3e14111f Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sat, 23 Feb 2019 11:26:21 -0500
|
|
Subject: [PATCH] Paper Utils
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
|
|
new file mode 100644
|
|
index 000000000..9db0056ab
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
|
|
@@ -0,0 +1,16 @@
|
|
+package com.destroystokyo.paper.util;
|
|
+
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+
|
|
+public class SneakyThrow {
|
|
+
|
|
+ public static void sneaky(@NotNull Throwable exception) {
|
|
+ SneakyThrow.<RuntimeException>throwSneaky(exception);
|
|
+ }
|
|
+
|
|
+ @SuppressWarnings("unchecked")
|
|
+ private static <T extends Throwable> void throwSneaky(@NotNull Throwable exception) throws T {
|
|
+ throw (T) exception;
|
|
+ }
|
|
+
|
|
+}
|
|
--
|
|
2.26.2
|
|
|