Search in sources :

Example 1 with IColouredItem

use of blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem in project ImmersiveEngineering by BluSunrize.

the class ClientProxy method init.

@Override
public void init() {
    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(ImmersiveModelRegistry.instance);
    ClientEventHandler handler = new ClientEventHandler();
    MinecraftForge.EVENT_BUS.register(handler);
    ((IReloadableResourceManager) ClientUtils.mc().getResourceManager()).registerReloadListener(handler);
    //		revolverTextureMap = new TextureMap("textures/revolvers",true);
    //		revolverTextureMap.setMipmapLevels(Minecraft.getMinecraft().gameSettings.mipmapLevels);
    //		Minecraft.getMinecraft().renderEngine.loadTickableTexture(revolverTextureResource, revolverTextureMap);
    //		Minecraft.getMinecraft().renderEngine.bindTexture(revolverTextureResource);
    //		revolverTextureMap.setBlurMipmapDirect(false, Minecraft.getMinecraft().gameSettings.mipmapLevels > 0);
    //		ClientUtils.mc().renderEngine.loadTextureMap(revolverTextureResource, revolverTextureMap);
    nixieFontOptional = IEConfig.nixietubeFont ? new IENixieFontRender() : ClientUtils.font();
    nixieFont = new IENixieFontRender();
    itemFont = new IEItemFontRender();
    TileEntityTeslaCoil.effectMap = ArrayListMultimap.create();
    //		//METAL
    //		RenderingRegistry.registerBlockHandler(new BlockRenderMetalDevices());
    //		RenderingRegistry.registerBlockHandler(new BlockRenderMetalDevices2());
    //		RenderingRegistry.registerBlockHandler(new BlockRenderMetalDecoration());
    //		RenderingRegistry.registerBlockHandler(new BlockRenderMetalMultiblocks());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityImmersiveConnectable.class, new TileRenderImmersiveConnectable());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnectorLV.class, new TileRenderConnectorLV());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnectorMV.class, new TileRenderConnectorMV());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTransformer.class, new TileRenderTransformer());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRelayHV.class, new TileRenderRelayHV());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnectorHV.class, new TileRenderConnectorHV());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTransformerHV.class, new TileRenderTransformer());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConnectorStructural.class, new TileRenderConnectorStructural());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLantern.class, new TileRenderLantern());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBreakerSwitch.class, new TileRenderBreakerSwitch());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnergyMeter.class, new TileRenderEnergyMeter());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectricLantern.class, new TileRenderElectricLantern());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFloodlight.class, new TileRenderFloodlight());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidPipe.class, new TileRenderFluidPipe());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidPump.class, new TileRenderFluidPump());
    //		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRedstoneBreaker.class, new TileRenderRedstoneBreaker());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChargingStation.class, new TileRenderChargingStation());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySampleDrill.class, new TileRenderSampleDrill());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTeslaCoil.class, new TileRenderTeslaCoil());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurret.class, new TileRenderTurret());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBelljar.class, new TileRenderBelljar());
    // MULTIBLOCKS
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMetalPress.class, new TileRenderMetalPress());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrusher.class, new TileRenderCrusher());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySheetmetalTank.class, new TileRenderSheetmetalTank());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySilo.class, new TileRenderSilo());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySqueezer.class, new TileRenderSqueezer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDieselGenerator.class, new TileRenderDieselGenerator());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBucketWheel.class, new TileRenderBucketWheel());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArcFurnace.class, new TileRenderArcFurnace());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoWorkbench.class, new TileRenderAutoWorkbench());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBottlingMachine.class, new TileRenderBottlingMachine());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMixer.class, new TileRenderMixer());
    //WOOD
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatermill.class, new TileRenderWatermill());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWindmill.class, new TileRenderWindmill());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWindmillAdvanced.class, new TileRenderWindmill());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityModWorkbench.class, new TileRenderWorkbench());
    //STONE
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoresample.class, new TileRenderCoresample());
    /**Colours*/
    for (Item item : IEContent.registeredIEItems) if (item instanceof IColouredItem && ((IColouredItem) item).hasCustomItemColours())
        ClientUtils.mc().getItemColors().registerItemColorHandler(IEDefaultColourHandlers.INSTANCE, item);
    for (Block block : IEContent.registeredIEBlocks) if (block instanceof IColouredBlock && ((IColouredBlock) block).hasCustomBlockColours())
        ClientUtils.mc().getBlockColors().registerBlockColorHandler(IEDefaultColourHandlers.INSTANCE, block);
    /**Render Layers*/
    Map<String, RenderPlayer> skinMap = Minecraft.getMinecraft().getRenderManager().getSkinMap();
    RenderPlayer render = skinMap.get("default");
    render.addLayer(new IEBipedLayerRenderer());
    render = skinMap.get("slim");
    render.addLayer(new IEBipedLayerRenderer());
}
Also used : IGuiItem(blusunrize.immersiveengineering.common.items.IEItemInterfaces.IGuiItem) IColouredItem(blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem) Item(net.minecraft.item.Item) IColouredItem(blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem) IColouredBlock(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IColouredBlock) IReloadableResourceManager(net.minecraft.client.resources.IReloadableResourceManager) Block(net.minecraft.block.Block) IColouredBlock(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IColouredBlock) IIEMetaBlock(blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IIEMetaBlock)

Example 2 with IColouredItem

use of blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem in project ImmersiveEngineering by BluSunrize.

the class IEBipedLayerRenderer method doRenderLayer.

@Override
public void doRenderLayer(EntityLivingBase living, float limbSwing, float prevLimbSwing, float partialTicks, float rotation, float yaw, float pitch, float scale) {
    if (living.getItemStackFromSlot(EntityEquipmentSlot.HEAD) != null && ItemNBTHelper.hasKey(living.getItemStackFromSlot(EntityEquipmentSlot.HEAD), "IE:Earmuffs")) {
        ItemStack earmuffs = ItemNBTHelper.getItemStack(living.getItemStackFromSlot(EntityEquipmentSlot.HEAD), "IE:Earmuffs");
        if (earmuffs != null) {
            GlStateManager.pushMatrix();
            ModelBiped model = IEContent.itemEarmuffs.getArmorModel(living, earmuffs, EntityEquipmentSlot.HEAD, null);
            ClientUtils.bindTexture(IEContent.itemEarmuffs.getArmorTexture(earmuffs, living, EntityEquipmentSlot.HEAD, "overlay"));
            model.render(living, limbSwing, prevLimbSwing, rotation, yaw, pitch, scale);
            int colour = ((IColouredItem) earmuffs.getItem()).getColourForIEItem(earmuffs, 0);
            GlStateManager.color((colour >> 16 & 255) / 255f, (colour >> 8 & 255) / 255f, (colour & 255) / 255f);
            ClientUtils.bindTexture(IEContent.itemEarmuffs.getArmorTexture(earmuffs, living, EntityEquipmentSlot.HEAD, null));
            model.render(living, limbSwing, prevLimbSwing, rotation, yaw, pitch, scale);
            GlStateManager.popMatrix();
        }
    }
}
Also used : ModelBiped(net.minecraft.client.model.ModelBiped) ItemStack(net.minecraft.item.ItemStack) IColouredItem(blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem)

Aggregations

IColouredItem (blusunrize.immersiveengineering.common.items.IEItemInterfaces.IColouredItem)2 IColouredBlock (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IColouredBlock)1 IIEMetaBlock (blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IIEMetaBlock)1 IGuiItem (blusunrize.immersiveengineering.common.items.IEItemInterfaces.IGuiItem)1 Block (net.minecraft.block.Block)1 ModelBiped (net.minecraft.client.model.ModelBiped)1 IReloadableResourceManager (net.minecraft.client.resources.IReloadableResourceManager)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1