summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/TileEntityCommand.java
blob: d9a04faefe270fc393b7b3e50749b4a3883a1788 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package net.minecraft.server;

public class TileEntityCommand extends TileEntity implements ICommandListener {

    private String a = "";

    public TileEntityCommand() {}

    public void b(String s) {
        this.a = s;
        this.update();
    }

    public void a(World world) {
        if (!world.isStatic) {
            MinecraftServer minecraftserver = MinecraftServer.getServer();

            if (minecraftserver != null && minecraftserver.getEnableCommandBlock()) {
                // CraftBukkit start - disable command block TODO: hook this up to bukkit API
                // ICommandHandler icommandhandler = minecraftserver.getCommandHandler();

                // icommandhandler.a(this, this.a);
                // CraftBukkit end
            }
        }
    }

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

    public void sendMessage(String s) {}

    public boolean a(int i, String s) {
        return i <= 2;
    }

    public String a(String s, Object... aobject) {
        return s;
    }

    public void b(NBTTagCompound nbttagcompound) {
        super.b(nbttagcompound);
        nbttagcompound.setString("Command", this.a);
    }

    public void a(NBTTagCompound nbttagcompound) {
        super.a(nbttagcompound);
        this.a = nbttagcompound.getString("Command");
    }

    public ChunkCoordinates b() {
        return new ChunkCoordinates(this.x, this.y, this.z);
    }

    public Packet l() {
        NBTTagCompound nbttagcompound = new NBTTagCompound();

        this.b(nbttagcompound);
        return new Packet132TileEntityData(this.x, this.y, this.z, 2, nbttagcompound);
    }
}