mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 14:12:20 -07:00
net.minecraft.server.commands
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/server/commands/GameModeCommand.java
|
||||
+++ b/net/minecraft/server/commands/GameModeCommand.java
|
||||
@@ -54,9 +_,14 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user