public boolean isTriggerActive(IStatementContainer container, IStatementParameter[] parameters) {
if (!(container instanceof IGate)) {
return false;
}
IGate gate = (IGate) container;
TileGenericPipe tile = (TileGenericPipe) gate.getPipe().getTile();
int inputLevel = tile.redstoneInput;
if (parameters.length > 0 && parameters[0] instanceof StatementParameterRedstoneGateSideOnly &&
((StatementParameterRedstoneGateSideOnly) parameters[0]).isOn) {
inputLevel = tile.redstoneInputSide[gate.getSide().ordinal()];
}
return inputLevel == level;
}