2013-04-13 16:35:13 +02:00
|
|
|
package buildcraft.api.gates;
|
|
|
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-08-08 19:10:11 +02:00
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.Icon;
|
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
public interface ITrigger {
|
|
|
|
|
2013-08-08 19:10:11 +02:00
|
|
|
/**
|
|
|
|
* Return your ID from the old API here, this is only used to convert old
|
|
|
|
* saves to the new format.
|
|
|
|
*/
|
|
|
|
int getLegacyId();
|
|
|
|
|
|
|
|
String getUniqueTag();
|
2013-04-13 16:35:13 +02:00
|
|
|
|
2013-08-08 19:10:11 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
Icon getIcon();
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
void registerIcons(IconRegister iconRegister);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if this trigger can accept parameters
|
|
|
|
*/
|
2013-08-08 19:10:11 +02:00
|
|
|
boolean hasParameter();
|
2013-04-13 16:35:13 +02:00
|
|
|
|
2013-11-06 02:07:38 +01:00
|
|
|
/**
|
|
|
|
* Return true if this trigger requires a parameter
|
|
|
|
*/
|
|
|
|
boolean requiresParameter();
|
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Return the trigger description in the UI
|
|
|
|
*/
|
2013-08-08 19:10:11 +02:00
|
|
|
String getDescription();
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
2013-08-08 19:10:11 +02:00
|
|
|
* Return true if the tile given in parameter activates the trigger, given
|
|
|
|
* the parameters.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-08-08 19:10:11 +02:00
|
|
|
boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
2013-08-08 19:10:11 +02:00
|
|
|
* Create parameters for the trigger. As for now, there is only one kind of
|
|
|
|
* trigger parameter available so this subprogram is final.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-08-08 19:10:11 +02:00
|
|
|
ITriggerParameter createParameter();
|
2013-04-13 16:35:13 +02:00
|
|
|
}
|