net.minecraftforge.client.MinecraftForgeClient Java Examples
The following examples show how to use
net.minecraftforge.client.MinecraftForgeClient.
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: ClientProxy.java From archimedes-ships with MIT License | 6 votes |
@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 #2
Source File: EnderStorageClientProxy.java From EnderStorage with MIT License | 6 votes |
@Override public void init() { if(config.getTag("checkUpdates").getBooleanValue(true)) CCUpdateChecker.updateCheck("EnderStorage"); ClientUtils.enhanceSupportersList("EnderStorage"); super.init(); PacketCustom.assignHandler(EnderStorageCPH.channel, new EnderStorageCPH()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(blockEnderChest), new ItemEnderStorageRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEnderChest.class, new EnderChestRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEnderTank.class, new EnderTankRenderer()); }
Example #3
Source File: ClientProxy.java From Framez with GNU General Public License v3.0 | 6 votes |
@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: RenderChiselSnowman.java From Chisel-2 with GNU General Public License v2.0 | 6 votes |
protected void renderEquippedItems(EntityChiselSnowman snowman, float size){ super.renderEquippedItems(snowman, size); ItemStack itemStack = snowman.getEquipmentInSlot(2); if(itemStack.getItem() instanceof ItemBlock){ GL11.glPushMatrix(); this.snowMan.head.postRender(0.0625F); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED); boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D)); if(is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())){ float f1 = 0.625F; GL11.glTranslatef(0.0F, -0.34375F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f1, -f1, f1); } this.renderManager.itemRenderer.renderItem(snowman, itemStack, 0); GL11.glPopMatrix(); } }
Example #5
Source File: RendererMultiLayer.java From Chisel-2 with GNU General Public License v2.0 | 6 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { if (blck == null || !(blck instanceof BlockMultiLayerBase)) return false; BlockMultiLayerBase block = (BlockMultiLayerBase) blck; if (MinecraftForgeClient.getRenderPass() == 0) { if (block.icon != null) { renderer.overrideBlockTexture = block.icon; renderer.renderStandardBlock(block, x, y, z); renderer.overrideBlockTexture = null; return true; } else if (block.base != null) { renderer.renderBlockByRenderType(block.base, x, y, z); return true; } } else { renderer.setRenderBounds(0, 0, 0, 1, 1, 1); return renderer.renderStandardBlock(block, x, y, z); } return false; }
Example #6
Source File: TranslocatorClientProxy.java From Translocators with MIT License | 6 votes |
public void init() { if(config.getTag("checkUpdates").getBooleanValue(true)) CCUpdateChecker.updateCheck("Translocator"); ClientUtils.enhanceSupportersList("Translocator"); super.init(); ClientRegistry.bindTileEntitySpecialRenderer(TileItemTranslocator.class, new TileTranslocatorRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileLiquidTranslocator.class, new TileTranslocatorRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileCraftingGrid.class, new TileCraftingGridRenderer()); PacketCustom.assignHandler(TranslocatorCPH.channel, new TranslocatorCPH()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(blockTranslocator), new ItemTranslocatorRenderer()); FMLCommonHandler.instance().bus().register(CraftingGridKeyHandler.instance); ClientRegistry.registerKeyBinding(CraftingGridKeyHandler.instance); }
Example #7
Source File: FrameBufferContainer.java From LookingGlass with GNU General Public License v3.0 | 6 votes |
private void allocateFrameBuffer() { if (this.framebuffer != 0) return; this.framebuffer = EXTFramebufferObject.glGenFramebuffersEXT(); //Release via: EXTFramebufferObject.glDeleteFramebuffersEXT(framebuffer); this.depthBuffer = EXTFramebufferObject.glGenRenderbuffersEXT(); //Release via: EXTFramebufferObject.glDeleteRenderbuffersEXT(depthBuffer); EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, this.framebuffer); EXTFramebufferObject.glBindRenderbufferEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer); if (MinecraftForgeClient.getStencilBits() == 0) EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, GL14.GL_DEPTH_COMPONENT24, width, height); else EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, width, height); EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer); if (MinecraftForgeClient.getStencilBits() != 0) EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer); this.texture = GL11.glGenTextures(); //Release via: GL11.glDeleteTextures(colorTexture); GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.texture); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, width, height, 0, GL11.GL_RGBA, GL11.GL_INT, (java.nio.ByteBuffer) null); EXTFramebufferObject.glFramebufferTexture2DEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, GL11.GL_TEXTURE_2D, this.texture, 0); EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0); }
Example #8
Source File: ClientProxy.java From GardenCollection with MIT License | 6 votes |
@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 #9
Source File: ClientProxy.java From Chisel with GNU General Public License v2.0 | 6 votes |
@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 #10
Source File: CableRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setBrightness(world, pos); IVertexOperation[] pipeline = {new Translation(pos)}; BlockCable blockCable = (BlockCable) state.getBlock(); TileEntityCable tileEntityCable = (TileEntityCable) blockCable.getPipeTileEntity(world, pos); if (tileEntityCable == null) return false; int paintingColor = tileEntityCable.getInsulationColor(); int connectedSidesMask = blockCable.getActualConnections(tileEntityCable, world); Insulation insulation = tileEntityCable.getPipeType(); Material material = tileEntityCable.getPipeMaterial(); if (insulation != null && material != null) { BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer(); if (renderLayer == BlockRenderLayer.CUTOUT) { renderCableBlock(material, insulation, paintingColor, renderState, pipeline, connectedSidesMask); } ICoverable coverable = tileEntityCable.getCoverableImplementation(); coverable.renderCovers(renderState, new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()), renderLayer); } return true; }
Example #11
Source File: InvPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setBrightness(world, pos); IVertexOperation[] pipeline = {new Translation(pos)}; BlockInventoryPipe block = (BlockInventoryPipe) state.getBlock(); TileEntityInventoryPipe tileEntity = (TileEntityInventoryPipe) block.getPipeTileEntity(world, pos); if (tileEntity == null) { return false; } int paintingColor = tileEntity.getInsulationColor(); int connectedSidesMask = block.getActualConnections(tileEntity, world); BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer(); if (renderLayer == BlockRenderLayer.SOLID) { renderPipe(renderState, pipeline, paintingColor, connectedSidesMask); } ICoverable coverable = tileEntity.getCoverableImplementation(); coverable.renderCovers(renderState, new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()), renderLayer); return true; }
Example #12
Source File: MetaTileEntityRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) { MetaTileEntity metaTileEntity = BlockMachine.getMetaTileEntity(world, pos); if (metaTileEntity == null) { return false; } CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); Matrix4 translation = new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()); BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer(); if (metaTileEntity.canRenderInLayer(renderLayer)) { renderState.lightMatrix.locate(world, pos); IVertexOperation[] pipeline = new IVertexOperation[]{renderState.lightMatrix}; metaTileEntity.renderMetaTileEntity(renderState, translation.copy(), pipeline); } Matrix4 coverTranslation = new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()); metaTileEntity.renderCovers(renderState, coverTranslation, renderLayer); if (metaTileEntity.isFragile() && renderLayer == BlockRenderLayer.CUTOUT) { TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks(); Random posRand = new Random(MathHelper.getPositionRandom(pos)); int destroyStage = posRand.nextInt(10); TextureAtlasSprite atlasSprite = textureMap.getAtlasSprite("minecraft:blocks/destroy_stage_" + destroyStage); for (EnumFacing face : EnumFacing.VALUES) { Textures.renderFace(renderState, translation, new IVertexOperation[0], face, Cuboid6.full, atlasSprite); } } return true; }
Example #13
Source File: WRLogicClientProxy.java From WirelessRedstone with MIT License | 5 votes |
@Override public void init() { super.init(); ClientUtils.enhanceSupportersList("WR-CBE|Logic"); MinecraftForgeClient.registerItemRenderer(itemwireless, new ItemWirelessRenderer()); }
Example #14
Source File: WRAddonClientProxy.java From WirelessRedstone with MIT License | 5 votes |
@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 #15
Source File: ClientProxy.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
public void registerModuleRenderers(){ Collection<Item> moduleItems = ModuleRegistrator.moduleItems.values(); Collection<Class<? extends TubeModule>> modules = ModuleRegistrator.modules.values(); Iterator<Item> itemIterator = moduleItems.iterator(); Iterator<Class<? extends TubeModule>> moduleIterator = modules.iterator(); while(itemIterator.hasNext()) { try { MinecraftForgeClient.registerItemRenderer(itemIterator.next(), new RenderItemTubeModule(moduleIterator.next().newInstance())); } catch(Exception e) { Log.error("Something happened when registering tube module renderers!"); e.printStackTrace(); } } }
Example #16
Source File: ClientProxy.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@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 #17
Source File: MultiLayerModel.java From OpenModsLib with MIT License | 5 votes |
@Nonnull @Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { final BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer(); if (layer == null) { return side == null? quads : ImmutableList.<BakedQuad> of(); } final IBakedModel model = models.get(layer); return MoreObjects.firstNonNull(model, missing).getQuads(state, side, rand); }
Example #18
Source File: ClientProxy.java From ExtraCells1 with MIT License | 5 votes |
public void RegisterRenderers() { try { ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolderingStation.class, new TileEntityRendererSolderingStation()); MinecraftForgeClient.registerItemRenderer(BlockEnum.SOLDERINGSTATION.getBlockInstance().blockID, new ItemRendererSolderingStation()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBusFluidStorage.class, new TileEntityRendererBusFluidStorage()); MinecraftForgeClient.registerItemRenderer(BlockEnum.FLUIDSTORAGE.getBlockInstance().blockID, new ItemRendererBusFluidStorage()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBusFluidImport.class, new TileEntityRendererBusFluidImport()); MinecraftForgeClient.registerItemRenderer(BlockEnum.FLUIDIMPORT.getBlockInstance().blockID, new ItemRendererBusFluidImport()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBusFluidExport.class, new TileEntityRendererBusFluidExport()); MinecraftForgeClient.registerItemRenderer(BlockEnum.FLUIDEXPORT.getBlockInstance().blockID, new ItemRendererBusFluidExport()); MinecraftForgeClient.registerItemRenderer(BlockEnum.CERTUSTANK.getBlockInstance().blockID, new ItemRendererCertusTank()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWalrus.class, new TileEntityRedererWalrus()); MinecraftForgeClient.registerItemRenderer(BlockEnum.CHROMIA.getBlockInstance().blockID, new ItemRendererWalrus()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLevelEmitterFluid.class, new TileEntityRendererLevelEmitterFluid()); MinecraftForgeClient.registerItemRenderer(BlockEnum.FLUIDLEVELEMITTER.getBlockInstance().blockID, new ItemRendererLevelEmitterFluid()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMonitorStorageFluid.class, new TileEntityRendererMonitorStorageFluid()); } catch (NullPointerException e) { System.out.println("Mod ExtraCells: Another mod probably overrid an ExtraCells item causing EC to cancel the registration of ItemRenderers!"); } }
Example #19
Source File: QCraftProxyClient.java From qcraft-mod with Apache License 2.0 | 5 votes |
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 #20
Source File: ClientProxy.java From Et-Futurum with The Unlicense | 5 votes |
private void registerItemRenderers() { if (EtFuturum.enableBanners) MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.banner), new ItemBannerRenderer()); if (EtFuturum.enableFancySkulls) MinecraftForgeClient.registerItemRenderer(Items.skull, new ItemSkullRenderer()); if (EtFuturum.enableBowRendering) MinecraftForgeClient.registerItemRenderer(Items.bow, new ItemBowRenderer()); }
Example #21
Source File: ClientProxy.java From NOVA-Core with GNU Lesser General Public License v3.0 | 5 votes |
@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 #22
Source File: ClientProxy.java From NewHorizonsCoreMod with GNU General Public License v3.0 | 5 votes |
@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 #23
Source File: CoverFacade.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { BlockRenderLayer oldLayer = MinecraftForgeClient.getRenderLayer(); ForgeHooksClient.setRenderLayer(layer); FacadeRenderer.renderBlockCover(renderState, translation, coverHolder.getWorld(), coverHolder.getPos(), attachedSide.getIndex(), facadeState, plateBox); ForgeHooksClient.setRenderLayer(oldLayer); }
Example #24
Source File: AbstractPerspectiveLayeredModel.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 5 votes |
@Override public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand, IModelData data) { RenderType layer = MinecraftForgeClient.getRenderLayer(); if (layer == null) { layer = generalLayer; } return getLayerQuads(state, side, layer, rand, data); }
Example #25
Source File: FluidPipeRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) { CCRenderState renderState = CCRenderState.instance(); renderState.reset(); renderState.bind(buffer); renderState.setBrightness(world, pos); BlockFluidPipe blockPipe = ((BlockFluidPipe) state.getBlock()); TileEntityFluidPipe tileEntityPipe = (TileEntityFluidPipe) blockPipe.getPipeTileEntity(world, pos); if (tileEntityPipe == null) { return false; } FluidPipeType fluidPipeType = tileEntityPipe.getPipeType(); Material pipeMaterial = tileEntityPipe.getPipeMaterial(); int paintingColor = tileEntityPipe.getInsulationColor(); if (fluidPipeType != null && pipeMaterial != null) { BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer(); if (renderLayer == BlockRenderLayer.CUTOUT) { int connectedSidesMask = blockPipe.getActualConnections(tileEntityPipe, world); IVertexOperation[] pipeline = new IVertexOperation[] {new Translation(pos)}; renderPipeBlock(pipeMaterial, fluidPipeType, paintingColor, renderState, pipeline, connectedSidesMask); } ICoverable coverable = tileEntityPipe.getCoverableImplementation(); coverable.renderCovers(renderState, new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()), renderLayer); } return true; }
Example #26
Source File: ClientProxy.java From Artifacts with MIT License | 4 votes |
@Override public void registerRenders() { int r = RenderingRegistry.getNextAvailableRenderId(); ISimpleBlockRenderingHandler handler = new RenderFakeBlock(r); RenderingRegistry.registerBlockHandler(handler); ((BlockIllusionary)BlockIllusionary.instance).renderType = r; // GameRegistry.registerTileEntity(TileEntitySpikes.class, "artifacts.spiketrap"); r = RenderingRegistry.getNextAvailableRenderId(); handler = new RenderArrowTrap(r); RenderingRegistry.registerBlockHandler(handler); ((BlockTrap)BlockTrap.instance).renderType = r; // GameRegistry.registerTileEntity(TileEntityTrap.class, "artifacts.arrowtrap"); // r = RenderingRegistry.getNextAvailableRenderId(); // handler = new RenderQuickSand(r); // RenderingRegistry.registerBlockHandler(handler); // ((BlockQuickSand)BlockQuickSand.instance).renderType = r; r = RenderingRegistry.getNextAvailableRenderId(); handler = new RenderCoverPlate(r); RenderingRegistry.registerBlockHandler(handler); ((BlockCoverPlate)BlockCoverPlate.instance).renderType = r; RenderingRegistry.registerEntityRenderingHandler(EntityClayGolem.class, new RenderClayGolem()); TileEntitySpecialRenderer render = new TESwordRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySword.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockSword.instance), new ItemRenderPedestal(render, new TileEntitySword())); render = new PedestalRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayPedestal.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockPedestal.instance), new ItemRenderPedestal(render, new TileEntityDisplayPedestal())); render = new SpikesRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySpikes.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockSpikes.instance), new ItemRenderPedestal(render, new TileEntitySpikes())); r = RenderingRegistry.getNextAvailableRenderId(); handler = new RenderLaserBeam(r); RenderingRegistry.registerBlockHandler(handler); ((BlockLaserBeam)BlockLaserBeam.instance).renderID = r; r = RenderingRegistry.getNextAvailableRenderId(); handler = new RenderLaserSource(r); RenderingRegistry.registerBlockHandler(handler); ((BlockLaserBeamSource)BlockLaserBeamSource.instance).renderID = r; if(Loader.isModLoaded("antiqueatlas")) { // AtlasAPI.getTileAPI().setTexture("wizardtower", new ResourceLocation("artifacts:textures/gui/tower.png")); } }
Example #27
Source File: WorldSceneRenderer.java From GregTech with GNU Lesser General Public License v3.0 | 4 votes |
/** * Renders scene on given coordinates with given width and height, and RGB background color * Note that this will ignore any transformations applied currently to projection/view matrix, * so specified coordinates are scaled MC gui coordinates. * It will return matrices of projection and view in previous state after rendering */ public void render(int x, int y, int width, int height, int backgroundColor) { Vec2f mousePosition = setupCamera(x, y, width, height, backgroundColor); if (renderCallback != null) { renderCallback.preRenderScene(this); } Minecraft minecraft = Minecraft.getMinecraft(); minecraft.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); BlockRendererDispatcher dispatcher = minecraft.getBlockRendererDispatcher(); BlockRenderLayer oldRenderLayer = MinecraftForgeClient.getRenderLayer(); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.getBuffer(); bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK); for (BlockPos pos : renderedBlocks) { if (renderFilter != null && !renderFilter.test(pos)) continue; //do not render if position is skipped IBlockState blockState = world.getBlockState(pos); for(BlockRenderLayer renderLayer : BlockRenderLayer.values()) { if (!blockState.getBlock().canRenderInLayer(blockState, renderLayer)) continue; ForgeHooksClient.setRenderLayer(renderLayer); dispatcher.renderBlock(blockState, pos, world, bufferBuilder); } } tessellator.draw(); ForgeHooksClient.setRenderLayer(oldRenderLayer); if (mousePosition != null) { this.lastHitBlock = handleMouseHit(mousePosition); } else { this.lastHitBlock = null; } if (lastHitBlock != null) { GlStateManager.disableTexture2D(); CCRenderState renderState = CCRenderState.instance(); renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR, tessellator.getBuffer()); ColourMultiplier multiplier = new ColourMultiplier(0); renderState.setPipeline(new Translation(lastHitBlock), multiplier); BlockFace blockFace = new BlockFace(); renderState.setModel(blockFace); for (EnumFacing renderSide : EnumFacing.VALUES) { float diffuse = LightUtil.diffuseLight(renderSide); int color = (int) (255 * diffuse); multiplier.colour = RenderUtil.packColor(color, color, color, 100); blockFace.loadCuboidFace(Cuboid6.full, renderSide.getIndex()); renderState.render(); } renderState.draw(); GlStateManager.enableTexture2D(); } resetCamera(); }
Example #28
Source File: ClientProxy.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
@Override public void registerSemiBlockRenderer(ItemSemiBlockBase semiBlock){ MinecraftForgeClient.registerItemRenderer(semiBlock, new RenderItemSemiBlock(semiBlock.semiBlockId)); }
Example #29
Source File: ClientProxy.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
private static void registerBaseModelRenderer(Item item, Class<? extends TileEntity> tileEntityClass, IBaseModel model){ RenderModelBase renderer = new RenderModelBase(model); ClientRegistry.bindTileEntitySpecialRenderer(tileEntityClass, renderer); MinecraftForgeClient.registerItemRenderer(item, renderer); }
Example #30
Source File: ClientProxy.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
@Override public void registerRenders(){ SPECIAL_RENDER_TYPE_VALUE = RenderingRegistry.getNextAvailableRenderId(); blockRenderers.add(new RenderElevatorFrame()); blockRenderers.add(new RenderChargingStationPad()); for(ISBRHPneumatic renderer : blockRenderers) { RenderingRegistry.registerBlockHandler(renderer); } RenderingRegistry.registerBlockHandler(new RenderModelBase()); // RenderingRegistry.registerBlockHandler(new RendererSpecialBlock()); registerBaseModelRenderer(Blockss.airCompressor, TileEntityAirCompressor.class, new ModelAirCompressor("airCompressor")); registerBaseModelRenderer(Blockss.advancedAirCompressor, TileEntityAdvancedAirCompressor.class, new ModelAirCompressor("advancedAirCompressor")); registerBaseModelRenderer(Blockss.assemblyController, TileEntityAssemblyController.class, new ModelAssemblyController()); registerBaseModelRenderer(Blockss.assemblyDrill, TileEntityAssemblyDrill.class, new ModelAssemblyDrill()); registerBaseModelRenderer(Blockss.assemblyIOUnit, TileEntityAssemblyIOUnit.class, new ModelAssemblyIOUnit()); registerBaseModelRenderer(Blockss.assemblyLaser, TileEntityAssemblyLaser.class, new ModelAssemblyLaser()); registerBaseModelRenderer(Blockss.assemblyPlatform, TileEntityAssemblyPlatform.class, new ModelAssemblyPlatform()); registerBaseModelRenderer(Blockss.chargingStation, TileEntityChargingStation.class, new ModelChargingStation()); registerBaseModelRenderer(Blockss.creativeCompressor, TileEntityCreativeCompressor.class, new BaseModel("creativeCompressor.obj")); registerBaseModelRenderer(Blockss.electrostaticCompressor, TileEntityElectrostaticCompressor.class, new BaseModel("electrostaticCompressor.obj")); registerBaseModelRenderer(Blockss.elevatorBase, TileEntityElevatorBase.class, new ModelElevatorBase()); registerBaseModelRenderer(Blockss.pneumaticDoor, TileEntityPneumaticDoor.class, new ModelPneumaticDoor()); registerBaseModelRenderer(Blockss.pneumaticDoorBase, TileEntityPneumaticDoorBase.class, new ModelPneumaticDoorBase()); registerBaseModelRenderer(Blockss.pressureChamberInterface, TileEntityPressureChamberInterface.class, new ModelPressureChamberInterface()); registerBaseModelRenderer(Blockss.securityStation, TileEntitySecurityStation.class, new ModelComputer(Textures.MODEL_SECURITY_STATION)); registerBaseModelRenderer(Blockss.universalSensor, TileEntityUniversalSensor.class, new ModelUniversalSensor()); registerBaseModelRenderer(Blockss.uvLightBox, TileEntityUVLightBox.class, new ModelUVLightBox()); registerBaseModelRenderer(Blockss.vacuumPump, TileEntityVacuumPump.class, new ModelVacuumPump()); registerBaseModelRenderer(Blockss.omnidirectionalHopper, TileEntityOmnidirectionalHopper.class, new ModelOmnidirectionalHopper(Textures.MODEL_OMNIDIRECTIONAL_HOPPER)); registerBaseModelRenderer(Blockss.liquidHopper, TileEntityLiquidHopper.class, new ModelLiquidHopper()); registerBaseModelRenderer(Blockss.programmer, TileEntityProgrammer.class, new ModelComputer(Textures.MODEL_PROGRAMMER)); registerBaseModelRenderer(Blockss.plasticMixer, TileEntityPlasticMixer.class, new ModelPlasticMixer()); registerBaseModelRenderer(Blockss.liquidCompressor, TileEntityLiquidCompressor.class, new BaseModel("liquidCompressor.obj")); registerBaseModelRenderer(Blockss.advancedLiquidCompressor, TileEntityAdvancedLiquidCompressor.class, new BaseModel("liquidCompressor.obj", "advancedLiquidCompressor.png")); registerBaseModelRenderer(Blockss.heatSink, TileEntityHeatSink.class, new ModelHeatSink()); registerBaseModelRenderer(Blockss.vortexTube, TileEntityVortexTube.class, new ModelVortexTube()); registerBaseModelRenderer(Blockss.thermopneumaticProcessingPlant, TileEntityThermopneumaticProcessingPlant.class, new ModelThermopneumaticProcessingPlant()); registerBaseModelRenderer(Blockss.refinery, TileEntityRefinery.class, new ModelRefinery()); registerBaseModelRenderer(Blockss.gasLift, TileEntityGasLift.class, new ModelGasLift()); registerBaseModelRenderer(Blockss.keroseneLamp, TileEntityKeroseneLamp.class, new ModelKeroseneLamp()); registerBaseModelRenderer(Blockss.sentryTurret, TileEntitySentryTurret.class, new ModelSentryTurret()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPressureTube.class, new RenderPressureTube()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAirCannon.class, new RenderAirCannon()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElevatorBase.class, new RenderElevatorBase()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAdvancedPressureTube.class, new RenderAdvancedPressureTube()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAphorismTile.class, new RenderAphorismTile()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElevatorCaller.class, new RenderElevatorCaller()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityProgrammableController.class, new RenderProgrammableController()); // ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySentryTurret.class, new RenderSentryTurret()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.pressureTube), new RenderItemPressureTube(false)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.advancedPressureTube), new RenderItemPressureTube(true)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.airCannon), new RenderModelBase(new ModelAirCannon())); MinecraftForgeClient.registerItemRenderer(Itemss.vortexCannon, new RenderItemVortexCannon()); // MinecraftForgeClient.registerItemRenderer(Blocks.elevatorBase, new RenderItemElevatorBase()); MinecraftForgeClient.registerItemRenderer(Itemss.cannonBarrel, new RenderItemCannonParts(false)); MinecraftForgeClient.registerItemRenderer(Itemss.stoneBase, new RenderItemCannonParts(true)); MinecraftForgeClient.registerItemRenderer(Itemss.pneumaticCylinder, new RenderItemPneumaticCilinder()); // MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.advancedPressureTube), new RenderItemAdvancedPressureTube()); MinecraftForgeClient.registerItemRenderer(Itemss.drone, new RenderItemDrone(false)); MinecraftForgeClient.registerItemRenderer(Itemss.logisticsDrone, new RenderItemDrone(true)); MinecraftForgeClient.registerItemRenderer(Itemss.programmingPuzzle, new RenderItemProgrammingPuzzle()); MinecraftForgeClient.registerItemRenderer(Itemss.minigun, new RenderItemMinigun()); if(Config.useHelmetModel) MinecraftForgeClient.registerItemRenderer(Itemss.pneumaticHelmet, new RenderItemPneumaticHelmet()); RenderingRegistry.registerEntityRenderingHandler(EntityVortex.class, new RenderEntityVortex()); RenderingRegistry.registerEntityRenderingHandler(EntityChopperSeeds.class, new RenderEntityChopperSeeds()); RenderingRegistry.registerEntityRenderingHandler(EntityPotionCloud.class, new RenderEntityPotionCloud()); RenderingRegistry.registerEntityRenderingHandler(EntityDrone.class, new RenderDrone(false)); RenderingRegistry.registerEntityRenderingHandler(EntityLogisticsDrone.class, new RenderDrone(true)); RenderingRegistry.registerEntityRenderingHandler(EntityProgrammableController.class, new RenderDrone(false)); RenderingRegistry.registerEntityRenderingHandler(EntityRing.class, new RenderEntityRing()); EntityRegistry.registerModEntity(EntityRing.class, "Ring", 100, PneumaticCraft.instance, 80, 1, true); registerModuleRenderers(); super.registerRenders(); }