Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Add the ability for commandblocks to be sent messages via the API.
Dieser Commit ist enthalten in:
Ursprung
ba325926d5
Commit
7722428895
@ -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() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren