From 43069a02a71dd8e45ad69424bd5b9fd0b62cd7f8 Mon Sep 17 00:00:00 2001
From: Kieran Wallbanks <kieran.wallbanks@gmail.com>
Date: Tue, 30 Mar 2021 13:28:44 +0100
Subject: [PATCH 1/2] Add external javadoc links

---
 build.gradle | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/build.gradle b/build.gradle
index ac0e56ca3..8ea2a7647 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,6 +47,8 @@ allprojects {
         options {
             destinationDir(file("docs"))
             addBooleanOption('html5', true)
+            links "https://jd.adventure.kyori.net/api/$adventureVersion/"
+            links "https://docs.oracle.com/en/java/javase/11/docs/api/"
         }
     }
 

From 3e43e68cf9afbea7fa7ca4ce8a70e747b51ccd9c Mon Sep 17 00:00:00 2001
From: Kieran Wallbanks <kieran.wallbanks@gmail.com>
Date: Tue, 30 Mar 2021 14:02:35 +0100
Subject: [PATCH 2/2] Fix javadoc search resulting in 404

---
 build.gradle | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/build.gradle b/build.gradle
index 8ea2a7647..ea7c8c35d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,6 +50,16 @@ allprojects {
             links "https://jd.adventure.kyori.net/api/$adventureVersion/"
             links "https://docs.oracle.com/en/java/javase/11/docs/api/"
         }
+
+        // see https://stackoverflow.com/a/56641766
+        doLast {
+            // Append the fix to the file
+            def searchScript = new File(destinationDir.getAbsolutePath() + '/search.js')
+            searchScript.append '\n\n' +
+                    'getURLPrefix = function(ui) {\n' +
+                    '    return \'\';\n' +
+                    '};\n'
+        }
     }
 
     checkstyle {