cpw.mods.fml.client.registry.RenderingRegistry Java Examples

The following examples show how to use cpw.mods.fml.client.registry.RenderingRegistry. 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: WerkstoffLoader.java    From bartworks with MIT License 6 votes vote down vote up
static void gameRegistryHandler() {
    if (SideReference.Side.Client)
        RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE);

    GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE");
    GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE");

    WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores");
    WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall");
    WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks");
    WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing);
    WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", blockCasingAdvanced);

    GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01");

    GTMetaItemEnhancer.init();
}
 
Example #2
Source File: ClientProxy.java    From BigReactors with MIT License 6 votes vote down vote up
@Override
public void init()
{
	super.init();

	FMLCommonHandler.instance().bus().register(new MultiblockClientTickHandler());
       FMLCommonHandler.instance().bus().register(new BRRenderTickHandler());

	BlockFuelRod.renderId = RenderingRegistry.getNextAvailableRenderId();
	ISimpleBlockRenderingHandler fuelRodISBRH = new SimpleRendererFuelRod();
	RenderingRegistry.registerBlockHandler(BlockFuelRod.renderId, fuelRodISBRH);
	
	BlockTurbineRotorPart.renderId = RenderingRegistry.getNextAvailableRenderId();
	ISimpleBlockRenderingHandler rotorISBRH = new RotorSimpleRenderer();
	RenderingRegistry.registerBlockHandler(BlockTurbineRotorPart.renderId, rotorISBRH);	
	
	if(BigReactors.blockTurbinePart != null) {
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurbineRotorBearing.class, new RotorSpecialRenderer());
	}
}
 
Example #3
Source File: ClientProxy.java    From Framez with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void registerRenderers() {

    MinecraftForge.EVENT_BUS.register(new IconSupplier());

    ClientRegistry.bindTileEntitySpecialRenderer(TileMoving.class, new RenderMoving());
    MinecraftForgeClient.registerItemRenderer(FramezItems.frame, new RenderFrame());

    RenderMotor motorRenderer = new RenderMotor();
    ClientRegistry.bindTileEntitySpecialRenderer(TileMotor.class, motorRenderer);
    RenderingRegistry.registerBlockHandler(motorRenderer);
    for (Block m : FramezBlocks.motors.keySet())
        MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(m), motorRenderer);

    MinecraftForge.EVENT_BUS.register(new RenderMovementBlocking());
    MinecraftForge.EVENT_BUS.register(new MOPHelper());
}
 
Example #4
Source File: ClientProxy.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
private void registerBlockRenderers() {
	if (EtFuturum.enableSlimeBlock)
		RenderingRegistry.registerBlockHandler(new BlockSlimeBlockRender());

	if (EtFuturum.enableDoors)
		RenderingRegistry.registerBlockHandler(new BlockDoorRenderer());

	if (EtFuturum.enableBanners)
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBanner.class, new TileEntityBannerRenderer());

	if (EtFuturum.enableFancySkulls)
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new TileEntityFancySkullRenderer());

	if (EtFuturum.enableChorusFruit) {
		RenderingRegistry.registerBlockHandler(new BlockEndRodRender());
		RenderingRegistry.registerBlockHandler(new BlockChorusFlowerRender());
		RenderingRegistry.registerBlockHandler(new BlockChorusPlantRender());
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEndRod.class, new TileEntityEndRodRenderer());
	}

	if (EtFuturum.enableColourfulBeacons)
		ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNewBeacon.class, new TileEntityNewBeaconRenderer());

	RenderingRegistry.registerBlockHandler(new BlockChestRenderer());
}
 
Example #5
Source File: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 6 votes vote down vote up
@Override
public void load()
{
    ItemQuantumGoggles.s_renderIndex = RenderingRegistry.addNewArmourRendererPrefix( "qcraft:goggles" );

    super.load();

    // Setup renderers
    int gateID = RenderingRegistry.getNextAvailableRenderId();
    QCraft.Blocks.quantumLogic.blockRenderID = gateID;

    m_renderBlocks = new RenderBlocks();
    QCraft.Blocks.qBlock.blockRenderID = RenderingRegistry.getNextAvailableRenderId();

    // Setup client forge handlers
    registerForgeHandlers();
}
 
Example #6
Source File: ItemRenderRemoteJar.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack stack, Object... data) {
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    AspectList aspects = ((ItemJarFilled)ConfigItems.itemJarFilled).getAspects(stack);
    if(aspects != null) {
        tile.aspect = aspects.getAspects()[0];
        tile.amount = aspects.getAmount(tile.aspect);
    } else {
        tile.aspect = null;
        tile.amount = 0;
    }

    if(stack.hasTagCompound()) {
        tile.networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId");
    }

    super.renderItem(type, stack, data);

    GL11.glPushMatrix();
    GL11.glTranslatef(0.5f, 0.5f, 0.5f);

    RenderingRegistry.instance().renderInventoryBlock(RenderBlocks.getInstance(), RegisteredBlocks.blockRemoteJar, 0, RegisteredBlocks.blockRemoteJar.getRenderType());
    GL11.glPopMatrix();
}
 
Example #7
Source File: ClientProxy.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static <T extends Render> T unregisterRenderer(Class<? extends Entity> entityClass, Class<T> renderClass) {
    Injector registry = new Injector(RenderingRegistry.instance());
    List entityRenderers = registry.getField("entityRenderers");

    if(entityRenderers == null) {
        FMLLog.severe("Failed to get entityRenderers field in RenderingRegistry!");
        return null;
    }

    for(int i = 0; i < entityRenderers.size(); i++) {
        Injector pair = new Injector(entityRenderers.get(i));

        Class<? extends Entity> target = pair.getField("target");

        if(entityClass.equals(target)) {
            Render render = pair.getField("renderer");
            if(renderClass.isInstance(render)) {
                entityRenderers.remove(i);
                return (T)render;
            }
        }
    }
    return null;
}
 
Example #8
Source File: Extracells.java    From ExtraCells1 with MIT License 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.RegisterItems();
	proxy.RegisterBlocks();
	proxy.RegisterRenderers();
	proxy.RegisterTileEntities();
	proxy.addRecipes();
	if (!debug)
		Util.addBasicBlackList(ItemEnum.FLUIDDISPLAY.getItemInstance().itemID, OreDictionary.WILDCARD_VALUE);
	Util.getCellRegistry().addCellHandler(new FluidCellHandler());
	LanguageRegistry.instance().addStringLocalization("itemGroup.Extra_Cells", "en_US", "Extra Cells");
	renderID = RenderingRegistry.getNextAvailableRenderId();
	RenderHandler handler = new RenderHandler(renderID);
	RenderingRegistry.registerBlockHandler(handler);

	// WAILA Support
	FMLInterModComms.sendMessage("Waila", "register", "extracells.integration.WAILA.WailaDataProvider.callbackRegister");

	
	// AE Spatial Storage Support
	proxy.registerMovables();
}
 
Example #9
Source File: FWBlock.java    From NOVA-Core with GNU Lesser General Public License v3.0 6 votes vote down vote up
public FWBlock(BlockFactory factory) {
	//TODO: Hack build() method
	super(getMcMaterial(factory));
	this.factory = factory;
	this.dummy = factory.build();
	if (dummy.components.has(BlockProperty.BlockSound.class)) {
		this.stepSound = new FWBlockSound(dummy.components.get(BlockProperty.BlockSound.class));
	} else {
		BlockProperty.BlockSound properties = dummy.components.add(new BlockProperty.BlockSound());
		properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.BREAK, new Sound("", soundTypeStone.getBreakSound()));
		properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.PLACE, new Sound("", soundTypeStone.func_150496_b()));
		properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.WALK, new Sound("", soundTypeStone.getStepResourcePath()));
		this.stepSound = soundTypeStone;
	}
	this.blockClass = dummy.getClass();

	// Recalculate super constructor things after loading the block properly
	this.opaque = isOpaqueCube();
	this.lightOpacity = isOpaqueCube() ? 255 : 0;

	if (FMLCommonHandler.instance().getSide().isClient()) {
		blockRenderingID = RenderingRegistry.getNextAvailableRenderId();
	}
}
 
Example #10
Source File: ClientProxy.java    From GardenCollection with MIT License 6 votes vote down vote up
@Override
public void registerRenderers () {
    heavyChainRenderID = RenderingRegistry.getNextAvailableRenderId();
    lightChainRenderID = RenderingRegistry.getNextAvailableRenderId();
    latticeRenderID = RenderingRegistry.getNextAvailableRenderId();
    lanternRenderID = RenderingRegistry.getNextAvailableRenderId();
    fenceRenderID = RenderingRegistry.getNextAvailableRenderId();
    sconceRenderID = RenderingRegistry.getNextAvailableRenderId();
    hoopRenderID = RenderingRegistry.getNextAvailableRenderId();

    lanternRenderer = new LanternRenderer();

    RenderingRegistry.registerBlockHandler(heavyChainRenderID, new HeavyChainRenderer());
    RenderingRegistry.registerBlockHandler(lightChainRenderID, new LightChainRenderer());
    RenderingRegistry.registerBlockHandler(latticeRenderID, new LatticeRenderer());
    RenderingRegistry.registerBlockHandler(lanternRenderID, lanternRenderer);
    RenderingRegistry.registerBlockHandler(fenceRenderID, new FenceRenderer());
    RenderingRegistry.registerBlockHandler(sconceRenderID, new CandelabraRenderer());
    RenderingRegistry.registerBlockHandler(hoopRenderID, new HoopRenderer());

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.lantern), new LanternItemRenderer());
}
 
Example #11
Source File: ClientProxy.java    From archimedes-ships with MIT License 6 votes vote down vote up
@Override
public void registerRenderers()
{
	RenderingRegistry.registerEntityRenderingHandler(EntityShip.class, new RenderShip());
	RenderingRegistry.registerEntityRenderingHandler(EntityParachute.class, new RenderParachute());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGauge.class, new TileEntityGaugeRenderer());
	ClientRegistry.bindTileEntitySpecialRenderer( TileEntityHelm.class, new TileEntityModelHelmRenderer() );
	ClientRegistry.bindTileEntitySpecialRenderer( TileEntityEngine.class, new TileEntityModelEngineRenderer() );
	MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock( ArchimedesShipMod.blockMarkShip ), new ItemModelHelmRenderer( new TileEntityModelHelmRenderer(), new TileEntityHelm() ) );
	MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock( ArchimedesShipMod.blockEngine ), new ItemModelEngineRenderer( new TileEntityModelEngineRenderer(), new TileEntityEngine() ) );
	//ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHelm.class, new TileEntityHelmRenderer());
	BlockGauge.gaugeBlockRenderID = RenderingRegistry.getNextAvailableRenderId();
	BlockSeat.seatBlockRenderID = RenderingRegistry.getNextAvailableRenderId();
	RenderingRegistry.registerBlockHandler(BlockSeat.seatBlockRenderID, new RenderBlockSeat());
	RenderingRegistry.registerBlockHandler(BlockGauge.gaugeBlockRenderID, new RenderBlockGauge());
}
 
Example #12
Source File: ClientProxy.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void init()
{
    RenderingRegistry.registerBlockHandler(new BlockMarbleStairsRenderer());
    RenderingRegistry.registerBlockHandler(new BlockMarblePaneRenderer());
    RenderingRegistry.registerBlockHandler(new BlockRoadLineRenderer());
    RenderingRegistry.registerBlockHandler(new BlockSnakeStoneRenderer());
    RenderingRegistry.registerBlockHandler(new BlockNoCTMRenderer());
    RenderingRegistry.registerBlockHandler(new BlockSpikesRenderer());
    RenderingRegistry.registerBlockHandler(new BlockMarblePillarRenderer());
    RenderingRegistry.registerBlockHandler(new BlockEldritchRenderer());
    RenderingRegistry.registerBlockHandler(new BlockAdvancedMarbleRenderer());
    RenderingRegistry.registerBlockHandler(new BlockCarpetRenderer());

    RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer());

    RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(Chisel.itemCloudInABottle));
    RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(Chisel.itemBallOMoss));

    MinecraftForgeClient.registerItemRenderer(Chisel.chisel, renderer);
}
 
Example #13
Source File: BlockAdvancedMarbleRenderer.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public BlockAdvancedMarbleRenderer()
{
    if(Chisel.RenderCTMId == 0)
    {
        Chisel.RenderCTMId = RenderingRegistry.getNextAvailableRenderId();

    }
}
 
Example #14
Source File: ChunkLoaderClientProxy.java    From ChickenChunks with MIT License 5 votes vote down vote up
@Override
public void init()
{
    if(config.getTag("checkUpdates").getBooleanValue(true))
        CCUpdateChecker.updateCheck("ChickenChunks");
    ClientUtils.enhanceSupportersList("ChickenChunks");
    
    super.init();

    PacketCustom.assignHandler(ChunkLoaderCPH.channel, new ChunkLoaderCPH());
    
    ClientRegistry.bindTileEntitySpecialRenderer(TileChunkLoader.class, new TileChunkLoaderRenderer());
    ClientRegistry.bindTileEntitySpecialRenderer(TileSpotLoader.class, new TileChunkLoaderRenderer());
    RenderingRegistry.registerBlockHandler(new ChunkLoaderSBRH());
}
 
Example #15
Source File: ClientProxy.java    From LookingGlass with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Run during mod init.
 */
@Override
public void init() {
	// We register the portal renderer here
	Render render;
	render = new RenderPortal();
	render.setRenderManager(RenderManager.instance);
	RenderingRegistry.registerEntityRenderingHandler(EntityPortal.class, render);
}
 
Example #16
Source File: ClientProxy.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void registerEntityRenderers() {
	if (EtFuturum.enableArmourStand)
		RenderingRegistry.registerEntityRenderingHandler(EntityArmourStand.class, new ArmourStandRenderer());
	if (EtFuturum.enableEndermite)
		RenderingRegistry.registerEntityRenderingHandler(EntityEndermite.class, new EndermiteRenderer());
	if (EtFuturum.enableRabbit)
		RenderingRegistry.registerEntityRenderingHandler(EntityRabbit.class, new RabbitRenderer());
	if (EtFuturum.enableLingeringPotions) {
		RenderingRegistry.registerEntityRenderingHandler(EntityLingeringPotion.class, new LingeringPotionRenderer());
		RenderingRegistry.registerEntityRenderingHandler(EntityLingeringEffect.class, new LingeringEffectRenderer());
	}
	if (EtFuturum.enableVillagerZombies)
		RenderingRegistry.registerEntityRenderingHandler(EntityZombieVillager.class, new VillagerZombieRenderer());
	if (EtFuturum.enableDragonRespawn)
		RenderingRegistry.registerEntityRenderingHandler(EntityPlacedEndCrystal.class, new PlacedEndCrystalRenderer());
	if (EtFuturum.enablePlayerSkinOverlay) {
		TextureManager texManager = Minecraft.getMinecraft().renderEngine;
		File fileAssets = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "fileAssets", "field_110446_Y", " field_110607_c");
		File skinFolder = new File(fileAssets, "skins");
		MinecraftSessionService sessionService = Minecraft.getMinecraft().func_152347_ac();
		ReflectionHelper.setPrivateValue(Minecraft.class, Minecraft.getMinecraft(), new NewSkinManager(Minecraft.getMinecraft().func_152342_ad(), texManager, skinFolder, sessionService), "field_152350_aA");

		RenderManager.instance.entityRenderMap.put(EntityPlayer.class, new NewRenderPlayer());
	}
	if (EtFuturum.enableShearableGolems)
		RenderingRegistry.registerEntityRenderingHandler(EntityNewSnowGolem.class, new NewSnowGolemRenderer());
}
 
Example #17
Source File: ClientProxy.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init() {
	RenderingRegistry.registerBlockHandler(new RendererCTM());
	RenderingRegistry.registerBlockHandler(new RendererStairs());
	RenderingRegistry.registerBlockHandler(new RendererCTMPane());
	RenderingRegistry.registerBlockHandler(new RendererRoadLine());
	RenderingRegistry.registerBlockHandler(new RendererSnakeStone());
	RenderingRegistry.registerBlockHandler(new RendererEldritch());
	RenderingRegistry.registerBlockHandler(new RendererLayeredGlow());
	RenderingRegistry.registerBlockHandler(new RendererSimpleLayered());
	
	RenderingRegistry.registerBlockHandler(new RendererMultiLayer());

	RenderAutoChisel rac = new RenderAutoChisel();
	RenderingRegistry.registerBlockHandler(rac);
	MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.autoChisel), rac);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, rac);
	
	RenderCarvableBeacon rcb = new RenderCarvableBeacon();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCarvableBeacon.class, rcb);
	RenderingRegistry.registerBlockHandler(rcb);
	BlockCarvableBeacon.renderId = rcb.getRenderId();
	
	RenderPresent rp = new RenderPresent();
	MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.present), rp);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, rp);

	RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ChiselItems.cloudinabottle));
	RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ChiselItems.ballomoss));
	RenderingRegistry.registerEntityRenderingHandler(EntitySmashingRock.class, new RenderSnowball(ChiselItems.smashingrock));
       RenderingRegistry.registerEntityRenderingHandler(EntityChiselSnowman.class, new RenderChiselSnowman());

	MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer);
	MinecraftForgeClient.registerItemRenderer(ChiselItems.diamondChisel, renderer);

	PlayerSpecials.init();
}
 
Example #18
Source File: ClientProxy.java    From NewHorizonsCoreMod with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void registerRenderInfo()
{
    BlockBabyChest.pRenderID = RenderingRegistry.getNextAvailableRenderId();
    TileEntitySpecialRenderer render = new RenderBabyChest();

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MainRegistry._mBlockBabyChest), new RenderItemBabyChest());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBabyChest.class, render);

    MinecraftForge.EVENT_BUS.register(CONFIG_HANDLER);
}
 
Example #19
Source File: ClientProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent evt) {
	super.preInit(evt);
	MinecraftForge.EVENT_BUS.register(RenderUtility.instance);
	ClientRegistry.bindTileEntitySpecialRenderer(FWTile.class, FWTileRenderer.instance);
	RenderingRegistry.registerEntityRenderingHandler(FWEntity.class, FWEntityRenderer.instance);
	RenderUtility.instance.preInit(evt);
}
 
Example #20
Source File: ClientProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void registerBlock(FWBlock block) {
	super.registerBlock(block);

	/**
	 * Registers a block rendering handler for this block
	 */
	RenderingRegistry.registerBlockHandler(block);
	MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(block), block);
}
 
Example #21
Source File: IntegrationThaumicHorizions.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void doInit() {
    if(Gadomancy.proxy.getSide() == Side.CLIENT) {
        RendererLivingEntity render = ClientProxy.unregisterRenderer(EntityGolemTH.class, RenderGolemTH.class);
        if(render != null) {
            RenderingRegistry.registerEntityRenderingHandler(EntityGolemTH.class, new RenderAdditionalGolemTH(render.mainModel));
        }

        modMatrix = Block.getBlockFromName("ThaumicHorizons:modMatrix");

        RegisteredBlocks.registerClawClickBehavior(new ClickBehavior(true) {
            private TileVat vat;

            @Override
            public boolean isValidForBlock() {
                if (block == modMatrix && metadata == 0) {
                    this.vat = ((TileVatMatrix) world.getTileEntity(x, y, z)).getVat();
                    return vat != null;
                }
                return false;
            }

            @Override
            public int getComparatorOutput() {
                return (vat.mode != 0 && vat.mode != 4) ? 15 : 0;
            }

            @Override
            public void addInstability(int instability) {
                vat.instability += Math.ceil(instability * 0.5);
            }
        });
    }

    MinecraftForge.EVENT_BUS.register(this);
}
 
Example #22
Source File: FluidLoader.java    From bartworks with MIT License 5 votes vote down vote up
public static void run() {
        FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId();
        short[] rgb = new short[3];
        Arrays.fill(rgb, (short) 255);
        FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb);
        FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20));
        FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720);
        FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85));
        FluidLoader.BioLabFluidMaterials = new Fluid[]{
                new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}),
                new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}),
                new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}),
                new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}),
        };

        FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length];
        for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) {
            FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]);
            FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000));
        }

//        BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB())));
        FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
        for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
            if (B.isBreedable()) {
                B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()}));
                FluidRegistry.registerFluid(B.getFluid());
                GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid");
                GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120);
            }
        }

        FluidLoader.bioFluidBlock = new BioFluidBlock();
        GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock");
        GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge");
        if (SideReference.Side.Client) {
            RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance);
            RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance);
        }
    }
 
Example #23
Source File: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
private void registerForgeHandlers()
{
    ForgeHandlers handlers = new ForgeHandlers();
    MinecraftForge.EVENT_BUS.register( handlers );
    FMLCommonHandler.instance().bus().register( handlers );

    // Logic gate rendering
    QuantumLogicBlockRenderingHandler logicHandler = new QuantumLogicBlockRenderingHandler();
    RenderingRegistry.registerBlockHandler( logicHandler );

    // qBlock rendering
    QBlockRenderingHandler qBlockHandler = new QBlockRenderingHandler();
    MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock( QCraft.Blocks.qBlock ), qBlockHandler );
    RenderingRegistry.registerBlockHandler( qBlockHandler );
}
 
Example #24
Source File: ClientProxy.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public void registerRenderers ()
{
    gardenProxyRenderID = RenderingRegistry.getNextAvailableRenderId();
    smallFireRenderID = RenderingRegistry.getNextAvailableRenderId();
    compostBinRenderID = RenderingRegistry.getNextAvailableRenderId();

    gardenProxyRenderer = new GardenProxyRenderer();
    smallFireRenderer = new SmallFireRenderer();
    compostBinRenderer = new CompostBinRenderer();

    RenderingRegistry.registerBlockHandler(gardenProxyRenderID, gardenProxyRenderer);
    RenderingRegistry.registerBlockHandler(smallFireRenderID, smallFireRenderer);
    RenderingRegistry.registerBlockHandler(compostBinRenderID, compostBinRenderer);
}
 
Example #25
Source File: BlockCarpetRenderer.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public BlockCarpetRenderer()
{
    super();

    Chisel.RenderCarpetId = RenderingRegistry.getNextAvailableRenderId();

    rendererCTM = new RenderBlocksCTMCarpet();
}
 
Example #26
Source File: ClientProxy.java    From OpenPeripheral-Addons with MIT License 5 votes vote down vote up
@Override
public void registerRenderInformation() {
	OpenPeripheralAddons.renderId = RenderingRegistry.getNextAvailableRenderId();
	final BlockRenderingHandler blockRenderingHandler = new BlockRenderingHandler(OpenPeripheralAddons.renderId);
	RenderingRegistry.registerBlockHandler(blockRenderingHandler);

	blockRenderingHandler.addRenderer(Blocks.pim, new BlockPIMRenderer());

	ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySensor.class, new TileEntitySensorRenderer());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySelector.class, new TileEntitySelectorRenderer());
}
 
Example #27
Source File: RenderAutoChisel.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
public RenderAutoChisel() {
	Chisel.renderAutoChiselId = RenderingRegistry.getNextAvailableRenderId();

	renderItem = new RenderItem() {

		@Override
		public boolean shouldBob() {
			return false;
		}
	};
	renderItem.setRenderManager(RenderManager.instance);
}
 
Example #28
Source File: WRAddonClientProxy.java    From WirelessRedstone with MIT License 5 votes vote down vote up
@Override
public void init() {
    super.init();
    ClientUtils.enhanceSupportersList("WR-CBE|Addons");

    WRCoreCPH.delegates.add(new WRAddonCPH());

    GuiWirelessSniffer.loadColours(SaveManager.config().getTag("addon"));
    MinecraftForgeClient.registerItemRenderer(tracker, new RenderTracker());
    MinecraftForgeClient.registerItemRenderer(wirelessMap, new WirelessMapRenderer());

    RenderingRegistry.registerEntityRenderingHandler(EntityREP.class, new RenderSnowball(rep));
    RenderingRegistry.registerEntityRenderingHandler(EntityWirelessTracker.class, new RenderTracker());
}
 
Example #29
Source File: ClientProxy.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public void registerRenderers ()
{
    thinLogRenderID = RenderingRegistry.getNextAvailableRenderId();
    flowerLeafRenderID = RenderingRegistry.getNextAvailableRenderId();
    thinLogFenceRenderID = RenderingRegistry.getNextAvailableRenderId();
    ivyRenderID = RenderingRegistry.getNextAvailableRenderId();

    RenderingRegistry.registerBlockHandler(thinLogRenderID, new ThinLogRenderer());
    RenderingRegistry.registerBlockHandler(flowerLeafRenderID, new FlowerLeafRenderer());
    RenderingRegistry.registerBlockHandler(thinLogFenceRenderID, new ThinLogFenceRenderer());
    RenderingRegistry.registerBlockHandler(ivyRenderID, new IvyRenderer());
}
 
Example #30
Source File: ClientProxy.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public void registerRenderers ()
{
    windowBoxRenderID = RenderingRegistry.getNextAvailableRenderId();
    decorativePotRenderID = RenderingRegistry.getNextAvailableRenderId();
    largePotRenderID = RenderingRegistry.getNextAvailableRenderId();
    mediumPotRenderID = RenderingRegistry.getNextAvailableRenderId();

    RenderingRegistry.registerBlockHandler(windowBoxRenderID, new WindowBoxRenderer());
    RenderingRegistry.registerBlockHandler(decorativePotRenderID, new DecorativePotRenderer());
    RenderingRegistry.registerBlockHandler(largePotRenderID, new LargePotRenderer());
    RenderingRegistry.registerBlockHandler(mediumPotRenderID, new MediumPotRenderer());
}