| 
									
										
										
										
											2015-05-25 20:37:24 +10:00
										 |  |  | --- a/net/minecraft/server/CommandBlockListenerAbstract.java
 | 
					
						
							|  |  |  | +++ b/net/minecraft/server/CommandBlockListenerAbstract.java
 | 
					
						
							| 
									
										
										
										
											2018-12-26 08:00:00 +11:00
										 |  |  | @@ -4,6 +4,7 @@
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  |  import java.text.SimpleDateFormat; | 
					
						
							| 
									
										
										
										
											2014-11-26 08:32:16 +11:00
										 |  |  |  import java.util.Date; | 
					
						
							| 
									
										
										
										
											2016-05-10 21:47:39 +10:00
										 |  |  |  import javax.annotation.Nullable; | 
					
						
							| 
									
										
										
										
											2017-06-26 08:27:25 +10:00
										 |  |  | +import org.bukkit.command.CommandSender;
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  |   | 
					
						
							| 
									
										
										
										
											2014-11-26 08:32:16 +11:00
										 |  |  |  public abstract class CommandBlockListenerAbstract implements ICommandListener { | 
					
						
							|  |  |  |   | 
					
						
							| 
									
										
										
										
											2018-12-26 08:00:00 +11:00
										 |  |  | @@ -15,6 +16,10 @@
 | 
					
						
							| 
									
										
										
										
											2019-04-23 12:00:00 +10:00
										 |  |  |      private IChatBaseComponent lastOutput; | 
					
						
							|  |  |  |      private String command = ""; | 
					
						
							|  |  |  |      private IChatBaseComponent customName = new ChatComponentText("@"); | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | +    // CraftBukkit start
 | 
					
						
							|  |  |  | +    @Override
 | 
					
						
							|  |  |  | +    public abstract CommandSender getBukkitSender(CommandListenerWrapper wrapper);
 | 
					
						
							|  |  |  | +    // CraftBukkit end
 | 
					
						
							| 
									
										
										
										
											2014-11-26 08:32:16 +11:00
										 |  |  |   | 
					
						
							|  |  |  |      public CommandBlockListenerAbstract() {} | 
					
						
							|  |  |  |   | 
					
						
							| 
									
										
										
										
											2018-12-26 08:00:00 +11:00
										 |  |  | @@ -102,14 +107,7 @@
 | 
					
						
							| 
									
										
										
										
											2019-07-20 09:00:00 +10:00
										 |  |  |                  if (minecraftserver != null && minecraftserver.F() && minecraftserver.getEnableCommandBlock() && !UtilColor.b(this.command)) { | 
					
						
							| 
									
										
										
										
											2017-05-14 12:00:00 +10:00
										 |  |  |                      try { | 
					
						
							| 
									
										
										
										
											2019-04-23 12:00:00 +10:00
										 |  |  |                          this.lastOutput = null; | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | -                        CommandListenerWrapper commandlistenerwrapper = this.getWrapper().a((commandcontext, flag, i) -> {
 | 
					
						
							|  |  |  | -                            if (flag) {
 | 
					
						
							| 
									
										
										
										
											2019-04-23 12:00:00 +10:00
										 |  |  | -                                ++this.successCount;
 | 
					
						
							| 
									
										
										
										
											2018-07-15 10:00:00 +10:00
										 |  |  | -                            }
 | 
					
						
							|  |  |  | -
 | 
					
						
							|  |  |  | -                        });
 | 
					
						
							|  |  |  | -
 | 
					
						
							| 
									
										
										
										
											2019-04-23 12:00:00 +10:00
										 |  |  | -                        minecraftserver.getCommandDispatcher().a(commandlistenerwrapper, this.command);
 | 
					
						
							|  |  |  | +                        this.successCount = minecraftserver.getCommandDispatcher().dispatchServerCommand(this.getWrapper(), this.command); // CraftBukkit
 | 
					
						
							| 
									
										
										
										
											2017-05-14 12:00:00 +10:00
										 |  |  |                      } catch (Throwable throwable) { | 
					
						
							|  |  |  |                          CrashReport crashreport = CrashReport.a(throwable, "Executing command block"); | 
					
						
							|  |  |  |                          CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed"); | 
					
						
							| 
									
										
										
										
											2018-12-26 08:00:00 +11:00
										 |  |  | @@ -140,6 +138,11 @@
 | 
					
						
							| 
									
										
										
										
											2018-07-16 16:20:46 +10:00
										 |  |  |      } | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |      public void setName(IChatBaseComponent ichatbasecomponent) { | 
					
						
							|  |  |  | +        // CraftBukkit start
 | 
					
						
							|  |  |  | +        if (ichatbasecomponent == null) {
 | 
					
						
							|  |  |  | +            ichatbasecomponent = new ChatComponentText("@");
 | 
					
						
							|  |  |  | +        }
 | 
					
						
							|  |  |  | +        // CraftBukkit end
 | 
					
						
							| 
									
										
										
										
											2019-04-23 12:00:00 +10:00
										 |  |  |          this.customName = ichatbasecomponent; | 
					
						
							| 
									
										
										
										
											2018-07-16 16:20:46 +10:00
										 |  |  |      } | 
					
						
							|  |  |  |   |