All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender Maven / Gradle / Ivy

The newest version!
package org.bukkit.craftbukkit.command;

import net.minecraft.server.ChatComponentText;
import net.minecraft.server.RemoteControlCommandListener;
import org.bukkit.command.RemoteConsoleCommandSender;

public class CraftRemoteConsoleCommandSender extends ServerCommandSender implements RemoteConsoleCommandSender {
  public CraftRemoteConsoleCommandSender() {
    super();
  }

  @Override
  public void sendMessage(String message) {
    RemoteControlCommandListener.getInstance().sendMessage(new ChatComponentText(message + "\n")); // Send a newline after each message, to preserve formatting.
  }

  @Override
  public void sendMessage(String[] messages) {
    for (String message : messages) {
      sendMessage(message);
    }
  }

  @Override
  public String getName() {
    return "Rcon";
  }

  @Override
  public boolean isOp() {
    return true;
  }

  @Override
  public void setOp(boolean value) {
    throw new UnsupportedOperationException("Cannot change operator status of remote controller.");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy