13
0
geforkt von Mirrors/Paper
Paper/paper-server/nms-patches/net/minecraft/server/commands/CommandGamemode.patch

16 Zeilen
839 B
Diff

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/server/commands/CommandGamemode.java
+++ b/net/minecraft/server/commands/CommandGamemode.java
@@ -63,6 +63,12 @@
if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
entityplayer.a(enumgamemode);
+ // CraftBukkit start - handle event cancelling the change
+ if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
2021-03-15 23:00:00 +01:00
+ commandcontext.getSource().sendFailureMessage(new net.minecraft.network.chat.ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
+ continue;
+ }
+ // CraftBukkit end
a((CommandListenerWrapper) commandcontext.getSource(), entityplayer, enumgamemode);
++i;
}