diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java b/paper-server/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java new file mode 100644 index 0000000000..89be6326f0 --- /dev/null +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java @@ -0,0 +1,42 @@ +package org.bukkit.craftbukkit.command; + +import net.minecraft.server.TileEntityCommand; +import org.bukkit.block.Block; +import org.bukkit.command.BlockCommandSender; + +/** + * Represents input from a command block + */ +public class CraftBlockCommandSender extends ServerCommandSender implements BlockCommandSender { + private final TileEntityCommand commandBlock; + + public CraftBlockCommandSender(TileEntityCommand commandBlock) { + super(); + this.commandBlock = commandBlock; + } + + public Block getBlock() { + return commandBlock.world.getWorld().getBlockAt(commandBlock.x, commandBlock.y, commandBlock.z); + } + + public void sendMessage(String message) { + } + + public void sendRawMessage(String message) { + } + + public void sendMessage(String[] messages) { + } + + public String getName() { + return "@"; + } + + public boolean isOp() { + return true; + } + + public void setOp(boolean value) { + throw new UnsupportedOperationException("Cannot change operator status of a block"); + } +}