public static void init(Class<?> clazz) {
AlchemyModLoader.checkState();
Listener listener = clazz.getAnnotation(Listener.class);
if (listener != null)
for (Listener.Type type : listener.value())
type.getEventBus().register(clazz);
if (Always.isClient()) {
Texture texture = clazz.getAnnotation(Texture.class);
if (texture != null)
if (texture.value() != null)
for (String res : texture.value())
texture_set.add(res);
else
AlchemyRuntimeException.onException(new NullPointerException(clazz + " -> @Texture.value()"));
Render render = clazz.getAnnotation(Render.class);
if (render != null)
if (render.value() != null) {
if (Tool.isSubclass(TileEntity.class, render.value()) && Tool.isSubclass(TileEntitySpecialRenderer.class, clazz))
try {
ClientRegistry.bindTileEntitySpecialRenderer(render.value(), (TileEntitySpecialRenderer) clazz.newInstance());
} catch (Exception e) { AlchemyRuntimeException.onException(e); }
else
AlchemyRuntimeException.onException(new RuntimeException(
"Can't bind Render: " + render.value().getName() + " -> " + clazz.getName()));
} else
AlchemyRuntimeException.onException(new NullPointerException(clazz + " -> @Render.value()"));
}
}
AlchemyEventSystem.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:Alchemy
作者:
评论列表
文章目录