Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Add Petal patches + refactor configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Blanchot committed Jul 21, 2022
1 parent 83dc602 commit 70131e8
Show file tree
Hide file tree
Showing 93 changed files with 1,906 additions and 1,723 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ group=wtf.etil.mirai
version=1.19-R0.1-SNAPSHOT
mcVersion=1.19
packageVersion=1_19_R1
pufferfishRef=ddbd29beb796b7878b8344543cf784794fd164eb
pufferfishRef=f6aa872dbfbb7c36c81d2043f4997c41fc0d065d

org.gradle.caching=true
org.gradle.caching.debug=false
org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.vfs.watch=false
org.gradle.daemon=false
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Djdk.nio.maxCachedBufferSize=262144
org.gradle.jvmargs=-Dfile.encoding=UTF-8
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0001-Mirai-Configuration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Mirai Configuration


diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e756edf56995f4552387c2e1082307eb3dd48bb3..58bb08e35e26400f967af89bfe963b23bc4ff79d 100644
index 56e261efa654e4a6872ccea28f0461df13845d13..b3421340e3cd0c091f6db2e1cb1b2f3201079a7e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1922,6 +1922,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1937,6 +1937,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Paper end

Expand Down
8 changes: 4 additions & 4 deletions patches/api/0003-Add-last-tick-time-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Original code by YatopiaMC, licensed under MIT
You can find the original code on https://github.com/YatopiaMC/Yatopia

diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 3506a7fa07ee6e53704b1df8d8d2bb08704bfc37..920b55c2b9f0209490271ce416c05f7a7d8e9b13 100644
index 92a1462261029e804da73da2743bbd68e57841e9..89babe7bec9eee5034aada0907de8d1d805bcdfe 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2380,6 +2380,16 @@ public final class Bukkit {
@@ -2397,6 +2397,16 @@ public final class Bukkit {
return server.isStopping();
}

Expand All @@ -28,10 +28,10 @@ index 3506a7fa07ee6e53704b1df8d8d2bb08704bfc37..920b55c2b9f0209490271ce416c05f7a
* Returns the {@link com.destroystokyo.paper.entity.ai.MobGoals} manager
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 58bb08e35e26400f967af89bfe963b23bc4ff79d..932fea11c30ddea6e7a3bf9d4ff516a8f792849c 100644
index b3421340e3cd0c091f6db2e1cb1b2f3201079a7e..7a202fb00f0f81de8c657d60a4d0fd9d3d653e58 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2081,6 +2081,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2096,6 +2096,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isStopping();

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0004-Optimize-Spigot-event-bus.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ index 419aec56b0e3fa8bcec2ea7f340caa3456b57d00..8530d926931a54ed1300c40cd1e0908b
}
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index aed2209b66f11a0d03473cf19437f3da0e9e573a..1e482ee08b2c0b155ac0a64f0913155f9612b83f 100644
index 6aba652af2b2f054ad22c77e4e59f0ed3eddc685..8c9b19888430421a8cdef91d707fb43efc7b15ea 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -648,11 +648,15 @@ public final class SimplePluginManager implements PluginManager {
@@ -653,11 +653,15 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void callEvent(@NotNull Event event) {
// Paper - replace callEvent by merging to below method
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0005-Skip-event-if-no-listeners.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Original code by Titaniumtown, licensed under GNU General Public License v3.0
You can find the original code on https://gitlab.com/Titaniumtown/JettPack

diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 1e482ee08b2c0b155ac0a64f0913155f9612b83f..c525e93712ceea029ed50237932d998610249205 100644
index 8c9b19888430421a8cdef91d707fb43efc7b15ea..a18724748aca4032981f1123055a9abefa77d9e1 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -647,6 +647,13 @@ public final class SimplePluginManager implements PluginManager {
@@ -652,6 +652,13 @@ public final class SimplePluginManager implements PluginManager {
*/
@Override
public void callEvent(@NotNull Event event) {
Expand All @@ -24,7 +24,7 @@ index 1e482ee08b2c0b155ac0a64f0913155f9612b83f..c525e93712ceea029ed50237932d9986
// Paper - replace callEvent by merging to below method
// KTP start - optimize spigot event bus
final boolean isAsync = event.isAsynchronous();
@@ -658,8 +665,8 @@ public final class SimplePluginManager implements PluginManager {
@@ -663,8 +670,8 @@ public final class SimplePluginManager implements PluginManager {
}
// KTP end - optimize spigot event bus

Expand Down
8 changes: 4 additions & 4 deletions patches/api/0007-Suspected-plugins-report.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Suspected plugins report
Added "Suspected Plugins" to Watchdog, crash reports and exception messages

diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index c525e93712ceea029ed50237932d998610249205..434d7c02001d16e542fd892ded23085fcf9e78a2 100644
index a18724748aca4032981f1123055a9abefa77d9e1..cd09dcb1a41cbea5ef9f726281a82b7d362efacb 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -618,7 +618,11 @@ public final class SimplePluginManager implements PluginManager {
@@ -623,7 +623,11 @@ public final class SimplePluginManager implements PluginManager {
// Paper start
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
Expand All @@ -22,7 +22,7 @@ index c525e93712ceea029ed50237932d998610249205..434d7c02001d16e542fd892ded23085f
gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
}
@@ -692,7 +696,11 @@ public final class SimplePluginManager implements PluginManager {
@@ -697,7 +701,11 @@ public final class SimplePluginManager implements PluginManager {
gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
// Paper start - error reporting
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
Expand All @@ -35,7 +35,7 @@ index c525e93712ceea029ed50237932d998610249205..434d7c02001d16e542fd892ded23085f
gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
@@ -978,4 +986,10 @@ public final class SimplePluginManager implements PluginManager {
@@ -983,4 +991,10 @@ public final class SimplePluginManager implements PluginManager {
}
// Paper end

Expand Down
8 changes: 4 additions & 4 deletions patches/server/0001-Mirai-Branding-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Mirai Branding Changes


diff --git a/build.gradle.kts b/build.gradle.kts
index a4a146d9c3e07bdf941d81147ca31daf4689a687..fb0da758cce2c7022aa23dfb3dc62f29513ba6a9 100644
index 74c91f79576e85618fefb79be8d313ba871701c7..17867a1cbf2e4aec601b2bc836a2b3a808feb5b7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ plugins {
Expand Down Expand Up @@ -69,7 +69,7 @@ index b0390eedb507d27426d1e1d73bd4ab63aec89ebe..509a9a5326d94200ca3d7a83ae47c6bb
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e96ff8b13b1237d7c70359b78e4d72938877191f..fc3d65885cc704f807ddcb07561b4a529827166c 100644
index 7fd7c3be306d93201a61bb616f8c09cb066d4204..e995aa81665bdf582f753acec3f0584f0060c851 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1656,7 +1656,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -82,10 +82,10 @@ index e96ff8b13b1237d7c70359b78e4d72938877191f..fc3d65885cc704f807ddcb07561b4a52

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 33218552405c526955d30031469d3044c724dde3..008e8cdb9bc17bbdcd4886fca8a50311262e457e 100644
index b5de069683a615be9b9b33c3d8e61e46bbbec8e3..2aece16c65245337e59f7b08d6fcd76916055fc2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -245,7 +245,7 @@ import javax.annotation.Nullable; // Paper
@@ -246,7 +246,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper

public final class CraftServer implements Server {
Expand Down
Loading

0 comments on commit 70131e8

Please sign in to comment.