diff options
Diffstat (limited to 'nms-patches/CommandGamemode.patch')
-rw-r--r-- | nms-patches/CommandGamemode.patch | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/nms-patches/CommandGamemode.patch b/nms-patches/CommandGamemode.patch index 3f4dd212..ac389787 100644 --- a/nms-patches/CommandGamemode.patch +++ b/nms-patches/CommandGamemode.patch @@ -1,21 +1,11 @@ ---- ../work/decompile-8eb82bde/net/minecraft/server/CommandGamemode.java 2014-12-15 14:13:23.910966159 +0000 -+++ src/main/java/net/minecraft/server/CommandGamemode.java 2014-12-15 14:13:23.910966159 +0000 -@@ -18,7 +18,7 @@ - return "commands.gamemode.usage"; - } - -- public void execute(ICommandListener icommandlistener, String[] astring) { -+ public void execute(ICommandListener icommandlistener, String[] astring) throws ExceptionUsage { // CraftBukkit - added throws - if (astring.length <= 0) { - throw new ExceptionUsage("commands.gamemode.usage", new Object[0]); - } else { -@@ -26,6 +26,14 @@ +--- /home/matt/mc-dev-private//net/minecraft/server/CommandGamemode.java 2015-02-26 22:40:22.343608142 +0000 ++++ src/main/java/net/minecraft/server/CommandGamemode.java 2015-02-26 22:40:22.351608142 +0000 +@@ -26,6 +26,13 @@ EntityPlayer entityplayer = astring.length >= 2 ? a(icommandlistener, astring[1]) : b(icommandlistener); - entityplayer.a(enumgamemode); -+ + entityplayer.a(worldsettings_enumgamemode); + // CraftBukkit start - handle event cancelling the change -+ if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) { ++ if (entityplayer.playerInteractManager.getGameMode() != worldsettings_enumgamemode) { + icommandlistener.sendMessage(new ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'")); + return; + } @@ -24,14 +14,14 @@ entityplayer.fallDistance = 0.0F; if (icommandlistener.getWorld().getGameRules().getBoolean("sendCommandFeedback")) { entityplayer.sendMessage(new ChatMessage("gameMode.changed", new Object[0])); -@@ -57,4 +65,11 @@ +@@ -57,4 +64,11 @@ public boolean isListStart(String[] astring, int i) { return i == 1; } + + // CraftBukkit start - fix decompiler error + @Override -+ public int compareTo(Object o) { ++ public int compareTo(ICommand o) { + return a((ICommand) o); + } + // CraftBukkit end |