diff --git a/patches/api/Add-PlayerSignCommandPreprocessEvent.patch b/patches/api/Add-PlayerSignCommandPreprocessEvent.patch index c70707fb3e0..7e83f06a032 100644 --- a/patches/api/Add-PlayerSignCommandPreprocessEvent.patch +++ b/patches/api/Add-PlayerSignCommandPreprocessEvent.patch @@ -13,14 +13,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +package io.papermc.paper.event.player; + +import org.bukkit.block.Sign; ++import org.bukkit.block.sign.Side; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; ++import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + +import java.util.Set; + +/** -+ * Called when a {@link Player} clicks a sign that causes a command to run. ++ * Called when a {@link Player} clicks a side on a sign that causes a command to run. + *

+ * This command is run with elevated permissions which allows players to access commands on signs they wouldn't + * normally be able to run. @@ -28,10 +30,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +public class PlayerSignCommandPreprocessEvent extends PlayerCommandPreprocessEvent { + + private final Sign sign; ++ private final Side side; + -+ public PlayerSignCommandPreprocessEvent(@NotNull Player player, @NotNull String message, @NotNull Set recipients, @NotNull Sign sign) { ++ @ApiStatus.Internal ++ public PlayerSignCommandPreprocessEvent(@NotNull Player player, @NotNull String message, @NotNull Set recipients, @NotNull Sign sign, final Side side) { + super(player, message, recipients); + this.sign = sign; ++ this.side = side; + } + + /** @@ -39,8 +44,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * @return the sign + */ -+ @NotNull -+ public Sign getSign() { -+ return sign; ++ public @NotNull Sign getSign() { ++ return this.sign; ++ } ++ ++ /** ++ * Gets the side of the sign that the command originated from. ++ * ++ * @return the sign side ++ */ ++ public @NotNull Side getSide() { ++ return this.side; + } +} diff --git a/patches/server/Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch index 21fe8e800d9..f0698bd77ba 100644 --- a/patches/server/Fix-commands-from-signs-not-firing-command-events.patch +++ b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch @@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (org.spigotmc.SpigotConfig.logCommands) { + LOGGER.info("{} issued server command: {}", player.getScoreboardName(), command); + } -+ io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent event = new io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent((org.bukkit.entity.Player) player.getBukkitEntity(), command, new org.bukkit.craftbukkit.util.LazyPlayerSet(player.getServer()), (org.bukkit.block.Sign) io.papermc.paper.util.MCUtil.toBukkitBlock(this.level, this.worldPosition).getState()); ++ io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent event = new io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent((org.bukkit.entity.Player) player.getBukkitEntity(), command, new org.bukkit.craftbukkit.util.LazyPlayerSet(player.getServer()), (org.bukkit.block.Sign) io.papermc.paper.util.MCUtil.toBukkitBlock(this.level, this.worldPosition).getState(), front ? Side.FRONT : Side.BACK); + if (!event.callEvent()) { + return false; + } diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 8d3f51595ab..bf62a4483e3 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -136,6 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") { + systemProperty("disable.watchdog", true) + } ++ systemProperty("io.papermc.paper.suppress.sout.nags", true) + + val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2") + minHeapSize = "${memoryGb}G"