use of buildcraft.core.lib.engines.RenderEngine in project BuildCraft by BuildCraft.
the class CoreProxyClient method init.
@Override
public void init() {
MinecraftForge.EVENT_BUS.register(RenderTickListener.INSTANCE);
IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();
IReloadableResourceManager reloadable = (IReloadableResourceManager) resourceManager;
reloadable.registerReloadListener(DetailedConfigOption.ReloadListener.INSTANCE);
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineBase.class, new RenderEngine());
ClientRegistry.bindTileEntitySpecialRenderer(TilePathMarker.class, new RenderPathMarker());
ClientRegistry.bindTileEntitySpecialRenderer(TileMarker.class, new RenderMarker());
RenderingRegistry.registerEntityRenderingHandler(EntityResizableCuboid.class, RenderResizableCuboid.INSTANCE);
RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());
for (Block block : blocksToRegisterRenderersFor) {
if (block instanceof IModelRegister) {
((IModelRegister) block).registerModels();
continue;
}
IBlockState defaultState = block.getDefaultState();
Multimap<Integer, IBlockState> metaStateMap = ArrayListMultimap.create();
Map<IBlockState, String> stateTypeMap = Maps.newHashMap();
for (IBlockState state : (List<IBlockState>) block.getBlockState().getValidStates()) {
String type = BuildCraftStateMapper.getPropertyString(state);
stateTypeMap.put(state, type);
metaStateMap.put(block.damageDropped(state), state);
}
for (Entry<Integer, Collection<IBlockState>> entry : metaStateMap.asMap().entrySet()) {
Collection<IBlockState> blockStates = entry.getValue();
if (blockStates.isEmpty())
continue;
if (blockStates.contains(defaultState)) {
registerBlockItemModel(defaultState, entry.getKey(), stateTypeMap.get(defaultState));
} else {
IBlockState state = blockStates.iterator().next();
registerBlockItemModel(state, entry.getKey(), stateTypeMap.get(state));
}
}
}
for (Item item : itemsToRegisterRenderersFor) {
if (item instanceof IModelRegister) {
((IModelRegister) item).registerModels();
}
}
}
Aggregations