summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/craftbukkit/command/CraftBlockCommandSender.java
blob: 89be6326f0547fb828fa254979b8d390845d1939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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");
    }
}