mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 18:37:35 +01:00
16 lines
794 B
Diff
16 lines
794 B
Diff
--- a/net/minecraft/server/CommandGamemode.java
|
|
+++ b/net/minecraft/server/CommandGamemode.java
|
|
@@ -57,6 +57,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;
|
|
}
|