mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-13 11:02:06 +01:00
Add the ability for commandblocks to be sent messages via the API.
By: Cory Redmond <acecheese@live.co.uk>
This commit is contained in:
parent
6d1b6a4ed0
commit
d99a0ceffa
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user