Java Code Examples for net.minecraftforge.fml.client.registry.ClientRegistry#bindTileEntityRenderer()

The following examples show how to use net.minecraftforge.fml.client.registry.ClientRegistry#bindTileEntityRenderer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProxyClient.java    From EnderStorage with MIT License 6 votes vote down vote up
@Override
public void clientSetup(FMLClientSetupEvent event) {
    ScreenManager.registerFactory(ModContent.containerItemStorage, GuiEnderItemStorage::new);

    spriteHelper.addIIconRegister(EnderPouchBakery.INSTANCE);
    ClientRegistry.bindTileEntityRenderer(tileEnderChestType, RenderTileEnderChest::new);
    ClientRegistry.bindTileEntityRenderer(tileEnderTankType, RenderTileEnderTank::new);

    if (!EnderStorageConfig.disableCreatorVisuals) {
        for (PlayerRenderer renderPlayer : Minecraft.getInstance().getRenderManager().getSkinMap().values()) {
            renderPlayer.addLayer(new TankLayerRenderer(renderPlayer));
        }
    }

    ModelResourceLocation invLocation = new ModelResourceLocation(itemEnderPouch.getRegistryName(), "inventory");
    modelHelper.register(invLocation, new CCBakeryModel());
    ModelBakery.registerItemKeyGenerator(itemEnderPouch, stack -> {
        Frequency frequency = Frequency.readFromStack(stack);
        boolean open = EnderStorageManager.instance(true).getStorage(frequency, EnderItemStorage.TYPE).openCount() > 0;
        return ModelBakery.defaultItemKeyGenerator.generateKey(stack) + "|" + frequency.toModelLoc() + "|" + open;
    });

    modelHelper.register(new ModelResourceLocation(itemEnderChest.getRegistryName(), "inventory"), new EnderChestItemRender());
    modelHelper.register(new ModelResourceLocation(itemEnderTank.getRegistryName(), "inventory"), new EnderTankItemRender());
}
 
Example 2
Source File: ClientEvents.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event)
{
    RenderingRegistry.registerEntityRenderingHandler(RockEntity.TYPE.get(),
            manager -> new SpriteRenderer<>(manager, Minecraft.getInstance().getItemRenderer()));

    ClientRegistry.bindTileEntityRenderer(DryingRackTileEntity.TYPE.get(), DryingRackRenderer::new);
    ClientRegistry.bindTileEntityRenderer(ChoppingBlockTileEntity.TYPE.get(), ChoppingBlockRenderer::new);
}
 
Example 3
Source File: ClientSetup.java    From MiningGadgets with MIT License 4 votes vote down vote up
/**
 * Client Registry for renders
 */
private static void registerRenderers() {
    //FMLJavaModLoadingContext.get().getModEventBus().addListener(event ->
            ClientRegistry.bindTileEntityRenderer(ModBlocks.RENDERBLOCK_TILE.get(), RenderBlockTER::new);
            //);
}