aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java
blob: 91219368b781e5ab16062536bc7ea3715b1fedfe (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
63
64
65
66
67
68
package gregtech.api.interfaces;

import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;

import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.GT_CoverBehavior;

/**
 * Implemented by the MetaTileEntity of the Redstone Circuit Block
 */
public interface IRedstoneCircuitBlock {

    /**
     * The Output Direction the Circuit Block is Facing
     */
    byte getOutputFacing();

    /**
     * sets Output Redstone State at Side
     */
    boolean setRedstone(byte aStrength, byte aSide);

    /**
     * returns Output Redstone State at Side Note that setRedstone checks if there is a Difference between the old and
     * the new Setting before consuming any Energy
     */
    byte getOutputRedstone(byte aSide);

    /**
     * returns Input Redstone Signal at Side
     */
    byte getInputRedstone(byte aSide);

    /**
     * If this Side is Covered up and therefor not doing any Redstone
     */
    GT_CoverBehavior getCover(byte aSide);

    int getCoverID(byte aSide);

    int getCoverVariable(byte aSide);

    /**
     * returns whatever Block-ID is adjacent to the Redstone Circuit Block
     */
    Block getBlockAtSide(byte aSide);

    /**
     * returns whatever Meta-Value is adjacent to the Redstone Circuit Block
     */
    byte getMetaIDAtSide(byte aSide);

    /**
     * returns whatever TileEntity is adjacent to the Redstone Circuit Block
     */
    TileEntity getTileEntityAtSide(byte aSide);

    /**
     * returns whatever TileEntity is used by the Redstone Circuit Block
     */
    ICoverable getOwnTileEntity();

    /**
     * returns worldObj.rand.nextInt(aRange)
     */
    int getRandom(int aRange);
}