Files
ForestryMC/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java
T
CovertJaguar ccdcce47cc Fixes #369 The Solding Iron and other Cicruit stuff should no longer crash if no layouts are defined.
The fix kind of grew out of control because I had to add a new EnumErrorCode and didn't want to keep breaking the API every time I did that. So I needed to decouple the ErrorStates from EnumErrorCode.
2014-12-15 07:45:10 -08:00

41 lines
1.4 KiB
Java

/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.apiculture.trigger;
import buildcraft.api.statements.IStatementContainer;
import buildcraft.api.statements.IStatementParameter;
import forestry.core.EnumErrorCode;
import forestry.core.interfaces.IErrorSource;
import forestry.core.triggers.Trigger;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TriggerMissingDrone extends Trigger {
public TriggerMissingDrone() {
super("missingDrone");
}
/**
* Return true if the tile given in parameter activates the trigger, given the parameters.
*/
@Override
public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) {
if (!(tile instanceof IErrorSource))
return false;
return ((IErrorSource) tile).getErrorState() == EnumErrorCode.NODRONE;
}
}