mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 14:33:56 +01:00
Add the ability for commandblocks to be sent messages via the API.
This commit is contained in:
parent
ba325926d5
commit
7722428895
@ -2,9 +2,11 @@ package org.bukkit.craftbukkit.command;
|
|||||||
|
|
||||||
import net.minecraft.server.ICommandListener;
|
import net.minecraft.server.ICommandListener;
|
||||||
import net.minecraft.server.CommandBlockListenerAbstract;
|
import net.minecraft.server.CommandBlockListenerAbstract;
|
||||||
|
import net.minecraft.server.IChatBaseComponent;
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.command.BlockCommandSender;
|
import org.bukkit.command.BlockCommandSender;
|
||||||
|
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents input from a command block
|
* Represents input from a command block
|
||||||
@ -22,9 +24,15 @@ public class CraftBlockCommandSender extends ServerCommandSender implements Bloc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String message) {
|
public void sendMessage(String message) {
|
||||||
|
for (IChatBaseComponent component : CraftChatMessage.fromString(message)) {
|
||||||
|
commandBlock.sendMessage(component);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String[] messages) {
|
public void sendMessage(String[] messages) {
|
||||||
|
for (String message : messages) {
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
Loading…
Reference in New Issue
Block a user