aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch')
-rw-r--r--patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch
new file mode 100644
index 0000000000..a11975f1ad
--- /dev/null
+++ b/patches/server/0801-Remove-client-side-code-using-deprecated-for-removal.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Fri, 26 Nov 2021 15:09:58 -0800
+Subject: [PATCH] Remove client-side code using deprecated for removal
+ AccessController
+
+Fixes warnings on build
+
+diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
+index d5a4e7d0ba2aff89e9aec64c8545c105926dcab4..e0a77a776533e48a3f8e2165eb77d4765213b79e 100644
+--- a/src/main/java/net/minecraft/Util.java
++++ b/src/main/java/net/minecraft/Util.java
+@@ -23,7 +23,6 @@ import java.net.URL;
+ import java.nio.file.Files;
+ import java.nio.file.Path;
+ import java.nio.file.spi.FileSystemProvider;
+-import java.security.AccessController;
+ import java.security.PrivilegedActionException;
+ import java.security.PrivilegedExceptionAction;
+ import java.time.Duration;
+@@ -764,21 +763,7 @@ public class Util {
+ }
+
+ public void openUrl(URL url) {
+- try {
+- Process process = AccessController.doPrivileged((PrivilegedExceptionAction<Process>)(() -> {
+- return Runtime.getRuntime().exec(this.getOpenUrlArguments(url));
+- }));
+-
+- for(String string : IOUtils.readLines(process.getErrorStream())) {
+- Util.LOGGER.error(string);
+- }
+-
+- process.getInputStream().close();
+- process.getErrorStream().close();
+- process.getOutputStream().close();
+- } catch (IOException | PrivilegedActionException var5) {
+- Util.LOGGER.error("Couldn't open url '{}'", url, var5);
+- }
++ throw new IllegalStateException("This method is not useful on dedicated servers."); // Paper
+
+ }
+