Other random classes

net/minecraft/core/dispenser/
This commit is contained in:
Owen1212055
2025-05-29 20:56:26 -04:00
parent 4a82168542
commit 6d71abd25f
10 changed files with 106 additions and 175 deletions

View File

@@ -1,26 +0,0 @@
From 09671551669244ef4f259d8b27547e463d6795d4 Mon Sep 17 00:00:00 2001
From: File <noreply+automated@papermc.io>
Date: Sun, 20 Apr 1997 15:37:42 +0200
Subject: [PATCH] paper File Patches
diff --git a/net/minecraft/server/commands/GameModeCommand.java b/net/minecraft/server/commands/GameModeCommand.java
index c112ca29596a68c6ba12dcc4d33460b4c181fa47..c44cdbbdc06b25bd20a208386545a10af9b96df8 100644
--- a/net/minecraft/server/commands/GameModeCommand.java
+++ b/net/minecraft/server/commands/GameModeCommand.java
@@ -54,9 +54,14 @@ public class GameModeCommand {
int i = 0;
for (ServerPlayer serverPlayer : players) {
- if (serverPlayer.setGameMode(gameType)) {
+ // Paper start - Expand PlayerGameModeChangeEvent
+ org.bukkit.event.player.PlayerGameModeChangeEvent event = serverPlayer.setGameMode(gameType, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.COMMAND, net.kyori.adventure.text.Component.empty());
+ if (event != null && !event.isCancelled()) {
logGamemodeChange(source.getSource(), serverPlayer, gameType);
i++;
+ } else if (event != null && event.cancelMessage() != null) {
+ source.getSource().sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(event.cancelMessage()), true);
+ // Paper end - Expand PlayerGameModeChangeEvent
}
}