mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
Use a compile time sneaky throw hack.
Fixes maven compilation for dependants.
This commit is contained in:
parent
b410a00a66
commit
508462b96b
1 changed files with 22 additions and 19 deletions
|
@ -1,28 +1,10 @@
|
|||
From cb86fe4037355f0e5012e3876ee8475d0db009c7 Mon Sep 17 00:00:00 2001
|
||||
From 4fb010dd6b5507a47f48993899029b58f863845e Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Sun, 1 Dec 2013 15:10:48 +1100
|
||||
Subject: [PATCH] mc-dev imports
|
||||
|
||||
Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods.
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 6aeffa8..3c0cdff 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -108,6 +108,13 @@
|
||||
<version>1.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
+ <dependency>
|
||||
+ <groupId>org.spigotmc</groupId>
|
||||
+ <artifactId>sneaky-throw</artifactId>
|
||||
+ <version>1.0</version>
|
||||
+ <scope>system</scope>
|
||||
+ <systemPath>${project.basedir}/../SneakyThrow.jar</systemPath>
|
||||
+ </dependency>
|
||||
</dependencies>
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
diff --git a/src/main/java/net/minecraft/server/AttributeRanged.java b/src/main/java/net/minecraft/server/AttributeRanged.java
|
||||
new file mode 100644
|
||||
index 0000000..d424f04
|
||||
|
@ -4212,6 +4194,27 @@ index 0000000..7ca18a1
|
|||
+ return new WorldGenVillageStart(this.c, this.b, i, j, this.f);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/SneakyThrow.java b/src/main/java/org/spigotmc/SneakyThrow.java
|
||||
new file mode 100644
|
||||
index 0000000..31fc0a9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/SneakyThrow.java
|
||||
@@ -0,0 +1,15 @@
|
||||
+package org.spigotmc;
|
||||
+
|
||||
+public class SneakyThrow
|
||||
+{
|
||||
+
|
||||
+ public static void sneaky(Throwable t)
|
||||
+ {
|
||||
+ throw SneakyThrow.<RuntimeException>superSneaky( t );
|
||||
+ }
|
||||
+
|
||||
+ private static <T extends Throwable> T superSneaky(Throwable t) throws T
|
||||
+ {
|
||||
+ throw (T) t;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/resources/org/spigotmc/SneakyThrow.class b/src/main/resources/org/spigotmc/SneakyThrow.class
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..635518693adaeee6f771d2a4c9f92672048a4c4d
|
||||
|
|
Loading…
Add table
Reference in a new issue