From 7722428895866b437c1cc88d0c963b1bbb1e5e12 Mon Sep 17 00:00:00 2001 From: Cory Redmond Date: Mon, 13 Apr 2015 02:15:16 +0200 Subject: [PATCH] Add the ability for commandblocks to be sent messages via the API. --- .../craftbukkit/command/CraftBlockCommandSender.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java index 96e9a710f9..01f616bba5 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java @@ -2,9 +2,11 @@ package org.bukkit.craftbukkit.command; import net.minecraft.server.ICommandListener; import net.minecraft.server.CommandBlockListenerAbstract; +import net.minecraft.server.IChatBaseComponent; import org.bukkit.block.Block; import org.bukkit.command.BlockCommandSender; +import org.bukkit.craftbukkit.util.CraftChatMessage; /** * Represents input from a command block @@ -22,9 +24,15 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc } public void sendMessage(String message) { + for (IChatBaseComponent component : CraftChatMessage.fromString(message)) { + commandBlock.sendMessage(component); + } } public void sendMessage(String[] messages) { + for (String message : messages) { + sendMessage(message); + } } public String getName() {