mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
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.
41 lines
1.4 KiB
Java
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;
|
|
|
|
}
|
|
|
|
}
|