From 117c56f3e13ae536c82672b33cd250e09c6a1253 Mon Sep 17 00:00:00 2001 From: Cryptite Date: Sat, 30 Dec 2023 08:02:33 -0600 Subject: [PATCH] Drop patch --- .gitignore | 1 + build.gradle.kts | 9 +++ gradle.properties | 2 +- gradlew | 43 +++++++---- .../0001-Add-PlayerShieldDisableEvent.patch | 72 ------------------- 5 files changed, 40 insertions(+), 87 deletions(-) delete mode 100644 patches/api/0001-Add-PlayerShieldDisableEvent.patch diff --git a/.gitignore b/.gitignore index 3a70449e9..0d77cbba6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ run slice-api slice-server +paper-api-generator # Ignore Gradle GUI config gradle-app.setting diff --git a/build.gradle.kts b/build.gradle.kts index 537882468..c77916cd1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,6 +65,15 @@ paperweight { serverPatchDir.set(layout.projectDirectory.dir("patches/server")) serverOutputDir.set(layout.projectDirectory.dir("slice-server")) } + + patchTasks { + register("generatedApi") { + isBareDirectory.set(true) + upstreamDirPath.set("paper-api-generator/generated") + patchDir.set(layout.projectDirectory.dir("patches/generatedApi")) + outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated")) + } + } } } diff --git a/gradle.properties b/gradle.properties index 92beb00dc..8dab92ea6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=com.lokamc.slice version=1.20.4-R0.1-SNAPSHOT mcVersion=1.20.4 -paperRef=8221b085f91a6ce65701b02fbb6a29e54bcc6023 +paperRef=0ae58c09a15ee1ad307a2b8ef7e8ad735d336651 org.gradle.caching=true org.gradle.parallel=true diff --git a/gradlew b/gradlew index 1b6c78733..31042a677 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,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. @@ -231,4 +246,4 @@ eval "set -- $( tr '\n' ' ' )" '"$@"' -exec "$JAVACMD" "$@" +exec "$JAVACMD" "$@" \ No newline at end of file diff --git a/patches/api/0001-Add-PlayerShieldDisableEvent.patch b/patches/api/0001-Add-PlayerShieldDisableEvent.patch deleted file mode 100644 index 2532bd30d..000000000 --- a/patches/api/0001-Add-PlayerShieldDisableEvent.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cryptite -Date: Fri, 12 Aug 2022 08:16:16 -0500 -Subject: [PATCH] Add PlayerShieldDisableEvent - - -diff --git a/src/main/java/io/papermc/paper/event/player/PlayerShieldDisableEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerShieldDisableEvent.java -new file mode 100644 -index 0000000000000000000000000000000000000000..d4bda54582228377c902e4743168e084e1bf8b2d ---- /dev/null -+++ b/src/main/java/io/papermc/paper/event/player/PlayerShieldDisableEvent.java -@@ -0,0 +1,60 @@ -+package io.papermc.paper.event.player; -+ -+import org.bukkit.entity.Entity; -+import org.bukkit.entity.Player; -+import org.bukkit.event.Cancellable; -+import org.bukkit.event.Event; -+import org.bukkit.event.HandlerList; -+import org.bukkit.event.player.PlayerEvent; -+import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; -+ -+/** -+ * Thrown whenever a Player's shield is disabled -+ */ -+public class PlayerShieldDisableEvent extends PlayerEvent implements Cancellable { -+ private static final HandlerList handlers = new HandlerList(); -+ private final Entity damager; -+ private int cooldown; -+ private boolean cancelled = false; -+ -+ public PlayerShieldDisableEvent(@NotNull final Player player, @Nullable final Entity damager, int cooldown) { -+ super(player); -+ this.damager = damager; -+ this.cooldown = cooldown; -+ } -+ -+ @Nullable -+ public Entity getDamager() { -+ return damager; -+ } -+ -+ public int getCooldown() { -+ return cooldown; -+ } -+ -+ public void setCooldown(int cooldown) { -+ this.cooldown = cooldown; -+ } -+ -+ @NotNull -+ @Override -+ public HandlerList getHandlers() { -+ return handlers; -+ } -+ -+ @NotNull -+ public static HandlerList getHandlerList() { -+ return handlers; -+ } -+ -+ @Override -+ public boolean isCancelled() { -+ return cancelled; -+ } -+ -+ @Override -+ public void setCancelled(boolean cancel) { -+ cancelled = cancel; -+ } -+}