mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 06:14:41 +00:00
Updated Cofh API
This commit is contained in:
1 parent
6cd3ae4fea
commit
90c1c690a9
37 files changed
+1026
-100
No files matched your search
@@ -0,0 +1,57 @@
|
||||
package cofh.api.tileentity;
|
||||
|
||||
/**
|
||||
* Implement this interface on Tile Entities which have Redstone Control functionality. This means that a tile can be set to ignore redstone entirely, or
|
||||
* respond to a low or high redstone state.
|
||||
*
|
||||
* @author King Lemming
|
||||
*
|
||||
*/
|
||||
public interface IRedstoneControl extends IRedstoneCache {
|
||||
|
||||
public static enum ControlMode {
|
||||
DISABLED(true), LOW(false), HIGH(true);
|
||||
|
||||
private final boolean state;
|
||||
|
||||
private ControlMode(boolean state) {
|
||||
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public boolean isDisabled() {
|
||||
|
||||
return this == DISABLED;
|
||||
}
|
||||
|
||||
public boolean isLow() {
|
||||
|
||||
return this == LOW;
|
||||
}
|
||||
|
||||
public boolean isHigh() {
|
||||
|
||||
return this == HIGH;
|
||||
}
|
||||
|
||||
public boolean getState() {
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
public static ControlMode stepForward(ControlMode curControl) {
|
||||
|
||||
return curControl == DISABLED ? LOW : curControl == HIGH ? DISABLED : HIGH;
|
||||
}
|
||||
|
||||
public static ControlMode stepBackward(ControlMode curControl) {
|
||||
|
||||
return curControl == DISABLED ? HIGH : curControl == HIGH ? LOW : DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
void setControl(ControlMode control);
|
||||
|
||||
ControlMode getControl();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user