Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/CraftBukkit-Patches/0039-Fix-crash-with-exceptions-in-command-block-commands.patch

31 Zeilen
1.4 KiB
Diff

From 65e4386d461d313d9de97bc9f27c0e7aaef60dbd Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Mar 2013 20:22:45 +1100
Subject: [PATCH] Fix crash with exceptions in command block commands.
---
src/main/java/net/minecraft/server/TileEntityCommand.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/TileEntityCommand.java b/src/main/java/net/minecraft/server/TileEntityCommand.java
index 4ff401b..10215ec 100644
--- a/src/main/java/net/minecraft/server/TileEntityCommand.java
+++ b/src/main/java/net/minecraft/server/TileEntityCommand.java
@@ -70,7 +70,12 @@ public class TileEntityCommand extends TileEntity implements ICommandListener {
// now dispatch all of the commands we ended up with
for (int i = 0; i < commands.size(); i++) {
- commandMap.dispatch(sender, joiner.join(Arrays.asList(commands.get(i))));
+ String[] cmd = commands.get(i);
+ try {
+ commandMap.dispatch(sender, joiner.join(Arrays.asList(cmd)));
+ } catch (org.bukkit.command.CommandException ex) {
+ org.bukkit.Bukkit.getServer().getLogger().log(java.util.logging.Level.WARNING, "Unexpected exception while parsing command block command \"" + cmd[0] + '"', ex);
+ }
}
// CraftBukkit end
}
--
1.8.1-rc2