2013-07-22 07:05:40 +02:00
|
|
|
package icbm.api;
|
|
|
|
|
|
|
|
import icbm.api.explosion.IExplosive;
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* General ICBM references.
|
|
|
|
*
|
|
|
|
* @author Calclavia
|
|
|
|
*
|
|
|
|
*/
|
2013-07-23 00:24:55 +02:00
|
|
|
public class ICBM
|
|
|
|
{
|
2013-07-22 07:05:40 +02:00
|
|
|
/**
|
|
|
|
* Name of the channel and mod ID.
|
|
|
|
*/
|
|
|
|
public static final String NAME = "ICBM";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The version of ICBM.
|
|
|
|
*/
|
|
|
|
public static final String MAJOR_VERSION = "@MAJOR@";
|
|
|
|
public static final String MINOR_VERSION = "@MINOR@";
|
|
|
|
public static final String REVISION_VERSION = "@REVIS@";
|
|
|
|
public static final String BUILD_VERSION = "@BUILD@";
|
2013-07-23 00:24:55 +02:00
|
|
|
public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION;
|
2013-07-22 07:05:40 +02:00
|
|
|
|
|
|
|
/**
|
2013-07-23 00:24:55 +02:00
|
|
|
* The block ID in which ICBM starts with. ICBM Explosion will count up, ICBM Contraption will
|
|
|
|
* count down.
|
2013-07-22 07:05:40 +02:00
|
|
|
*/
|
|
|
|
public static final int BLOCK_ID_PREFIX = 3880;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The item ID in which ICBM starts with.
|
|
|
|
*/
|
|
|
|
public static final int ITEM_ID_PREFIX = 3900;
|
|
|
|
|
|
|
|
public static Class explosionManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Gets an explosive object based on the name of the explosive.
|
|
|
|
*/
|
2013-07-23 00:24:55 +02:00
|
|
|
public static IExplosive getExplosive(String name)
|
|
|
|
{
|
|
|
|
if (name != null)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2013-07-22 07:05:40 +02:00
|
|
|
Method method = explosionManager.getMethod("get", String.class);
|
|
|
|
return (IExplosive) method.invoke(null, name);
|
2013-07-23 00:24:55 +02:00
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
System.out.println("ICBM: Failed to get explosive with the name: " + name);
|
2013-07-22 07:05:40 +02:00
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|