Updated RF / coflib API.

This commit is contained in:
CrazyPants committed 2014-05-21 09:11:35 +08:00
1 parent 00b567c494
commit 8ec56a01d2
10 files changed
+93 -97

No files matched your search

@@ -1,27 +1,57 @@
package cofh.api.tileentity;
/**
* Implement this interface on Tile Entities which have redstone control functionality.
* 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 {
public interface IRedstoneControl extends IRedstoneCache {
public boolean getControlDisable();
public static enum ControlMode {
DISABLED(true), LOW(false), HIGH(true);
public boolean getControlSetting();
private final boolean state;
public boolean setControlDisable(boolean disable);
private ControlMode(boolean state) {
public boolean setControlSetting(boolean state);
this.state = state;
}
public boolean setRedstoneConfig(boolean disable, boolean state);
public boolean isDisabled() {
public boolean isPowered();
return this == DISABLED;
}
public void handlePowerUpdate(boolean powered);
public boolean isLow() {
public void handleConfigUpdate(boolean disable, boolean state);
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;
}
}
public void setControl(ControlMode control);
public ControlMode getControl();
}