本文整理汇总了Java中cpw.mods.fml.relauncher.ReflectionHelper.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionHelper.getClass方法的具体用法?Java ReflectionHelper.getClass怎么用?Java ReflectionHelper.getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.relauncher.ReflectionHelper
的用法示例。
在下文中一共展示了ReflectionHelper.getClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAppEngApi
import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
/**
* All future API calls should be made via this method.
* @return
*/
public static IAppEngApi getAppEngApi()
{
try {
Class c = ReflectionHelper.getClass( Util.class.getClassLoader(), "appeng.common.AppEngApi" );
api = (IAppEngApi) c.getMethod( "getInstance" ).invoke( c );
} catch ( Throwable e) {
return null;
}
return api;
}
示例2: initialize
import cpw.mods.fml.relauncher.ReflectionHelper; //导入方法依赖的package包/类
/**
* Initializes the AestusCraft API.
*
* Only AestusCraft should call this method.
*/
public static void initialize()
{
if (m_Initialized)
{
return;
}
AestusCraftAPI.log = Logger.getLogger("AestusCraft-API");
AestusCraftAPI.log.setParent(FMLLog.getLogger());
Class<?> registryClass = ReflectionHelper.getClass(AestusCraftAPI.class.getClassLoader(), "dk.kiljacken.aestuscraft.core.Registry");
try
{
Object nil = null;
m_BlockMap = ReflectionUtil.getPrivateValue(registryClass, nil, "m_BlockMap");
m_ItemMap = ReflectionUtil.getPrivateValue(registryClass, nil, "m_ItemMap");
m_Initialized = true;
}
catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e)
{
AestusCraftAPI.log.severe("Exception while initializing AestusCraft API");
AestusCraftAPI.log.severe("Parent mod: " + Loader.instance().activeModContainer().getName());
throw new RuntimeException(e);
}
}