3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/nms-patches/CommandGamemode.patch
2018-12-26 08:00:00 +11:00

16 Zeilen
794 B
Diff

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