public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) { TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityShulkerBox.class); if (!(tileentityspecialrenderer instanceof TileEntityShulkerBoxRenderer)) { return null; } else { if (tileentityspecialrenderer.getEntityClass() == null) { tileentityspecialrenderer = new TileEntityShulkerBoxRenderer((ModelShulker)modelBase); tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); } if (!Reflector.TileEntityShulkerBoxRenderer_model.exists()) { Config.warn("Field not found: TileEntityShulkerBoxRenderer.model"); return null; } else { Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityShulkerBoxRenderer_model, modelBase); return tileentityspecialrenderer; } } }
@Override public void init(FMLInitializationEvent e) { super.init(e); Register.registerGlobalEntityID(EntityLaser.class, "laser"); Register.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser()); Register.registerItemRenderer(RorysMod.items.rifle1, new RenderRifle()); Register.registerItemRenderer(RorysMod.items.rifle2, new RenderRifle()); Register.registerItemRenderer(RorysMod.items.rifle3, new RenderRifle()); Register.registerItemRenderer(RorysMod.items.rifle4, new RenderRifle()); Register.registerItemRenderer(RorysMod.items.rifle5, new RenderRifle()); TileEntitySpecialRenderer render = new RenderRifleTable(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRifleTable.class, render); Register.registerItemRenderer(Item.getItemFromBlock(RorysMod.blocks.upgradeTable), new ItemRender(render, new TileEntityRifleTable())); render = new RenderPoweredChest(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPoweredChest.class, render); FMLInterModComms.sendMessage("Waila", "register", WailaConfig.class.getName() + ".callbackRegister"); }
public void renderChest(EntityBoatChest entity, float partialTicks) { TileEntitySpecialRenderer<TileEntityChest> renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(DUMMY_CHEST); if(renderer != null) { GlStateManager.pushMatrix(); GlStateManager.translate(-0.5, 0.125, -0.5); GlStateManager.rotate(180, 1, 0, 0); GlStateManager.rotate(90, 0, 1, 0); DUMMY_CHEST.numPlayersUsing = entity.getPlayersUsing(); DUMMY_CHEST.lidAngle = entity.getLidAngle(); DUMMY_CHEST.prevLidAngle = entity.getPrevLidAngle(); DUMMY_CHEST.setWorld(Boatifull.proxy.getClientWorld()); renderer.renderTileEntityAt(DUMMY_CHEST, 0, 0, 0, partialTicks, -1); GlStateManager.popMatrix(); } }
@SideOnly(Side.CLIENT) public void renderEntity(IGuiLexiconEntry gui, TileEntity entity, int x, int y, int scale, float rotation) { entity.setWorldObj(Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().theWorld : null); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glPushMatrix(); GL11.glTranslatef(x, y, 75.0F); GL11.glScalef(-scale, scale, scale); GL11.glRotatef(180F, 0.0F, 0.25F, 1.0F); GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); RenderHelper.enableStandardItemLighting(); GL11.glTranslatef(0.0F, 0, 0.0F); RenderManager.instance.playerViewY = 180.0F; TileEntitySpecialRenderer render = TileEntityRendererDispatcher.instance.getSpecialRenderer(te); if(render != null) render.renderTileEntityAt(entity, 0, 0, 0, 1); GL11.glPopMatrix(); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); if(relativeMouseX >= x - width * scale / 2 - 10 && relativeMouseY >= y - height * scale - 20 && relativeMouseX <= x + width * scale / 2 + 10 && relativeMouseY <= y + 20) tooltipEntity = true; }
public void registerRenderers(){ TileEntitySpecialRenderer render = new RenderElectricEngine(); TileEntitySpecialRenderer render2 = new RenderOilEngine(); TileEntitySpecialRenderer render3 = new RenderOilPump(); TileEntitySpecialRenderer render4 = new RenderLiquidTank(); TileEntitySpecialRenderer render5 = new RenderFluidPipe(); TileEntitySpecialRenderer render6 = new RenderElectricPipe(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectricEngine.class, render); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilEngine.class, render2); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilPump.class, render3); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidPipe.class, render5); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLiquidTank.class, render4); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectricPipe.class, render6); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.electricEngine), new ItemRendererElectricEngine(render, new TileEntityElectricEngine())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.oilEngine), new ItemRendererOilEngine(render2, new TileEntityOilEngine())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.oilPump), new ItemRendererOilPump(render3, new TileEntityOilPump())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.liquidTank), new ItemRendererLiquidTank(render4, new TileEntityLiquidTank())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.fluidPipe), new ItemRendererFluidPipe(render5, new TileEntityFluidPipe())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(TectoCraft.electricPipe), new ItemRendererElectricPipe(render6, new TileEntityElectricPipe())); MinecraftForgeClient.registerItemRenderer(TectoCraft.minigun, new ItemRenderMinigun()); MinecraftForgeClient.registerItemRenderer(TectoCraft.iphone6, new ItemRenderIphone6()); MinecraftForgeClient.registerItemRenderer(TectoCraft.nethersBane, new ItemRenderNethersBane()); MinecraftForgeClient.registerItemRenderer(TectoCraft.tectonicMultitool, new ItemRenderTectoMultitool()); }
public static void initMod() { MinecraftForgeClient.registerItemRenderer(ModItems.bioCrystal, new ItemRendererBioCrystal()); MinecraftForgeClient.registerItemRenderer(ModItems.infusedHoe, new ItemRendererInfusedHoe()); MinecraftForgeClient.registerItemRenderer(ModItems.infusedHoeOne, new ItemRendererInfusedHoe()); TileEntitySpecialRenderer render = new BlockRendererBioGenerator(); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.bioGen), new ItemRendererBioGenerator(render, new TileEntityBioGenerator())); TileEntitySpecialRenderer render1 = new BlockRendererBioInfuser(); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.bioInfuser), new ItemRendererBioInfuser(render1, new TileEntityBioInfuser())); TileEntitySpecialRenderer render2 = new BlockRendererBioExtractor(); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.bioExtractor), new ItemRendererBioExtractor(render2, new TileEntityBioExtractor())); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBioGenerator.class, new BlockRendererBioGenerator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBioInfuser.class, new BlockRendererBioInfuser()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBioExtractor.class, new BlockRendererBioExtractor()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBioPipe.class, new TileEntityRendererPipe()); }
public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(EntityZertum.class, new RenderZertum(new ModelZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityRedZertum.class, new RenderRedZertum(new ModelRedZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityDarkZertum.class, new RenderDarkZertum(new ModelDarkZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityDestroZertum.class, new RenderDestroZertum(new ModelDestroZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityJakan.class, new RenderJakan(new ModelJakan(), 1.0F)); RenderingRegistry.registerEntityRenderingHandler(EntityIceZertum.class, new RenderIceZertum(new ModelIceZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityForisZertum.class, new RenderForisZertum(new ModelForisZertum(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityKurr.class, new RenderKurr(new ModelKurr(), 1.0F)); RenderingRegistry.registerEntityRenderingHandler(EntityKortor.class, new RenderKortor(new ModelKortor(), 1.0F)); RenderingRegistry.registerEntityRenderingHandler(EntityFlamingPoisonball.class, new RenderFPoisonball(1)); RenderingRegistry.registerEntityRenderingHandler(EntityIceball.class, new RenderIceball(Items.snowball, 1)); RenderingRegistry.registerEntityRenderingHandler(EntityFireball.class, new RenderFireball(Items.fire_charge, 1)); RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade(ModItems.nileGrenade)); TileEntitySpecialRenderer render = new RendererNileTable(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNileTable.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.nileWorktable), new ItemRendererNileTable(render, new TileEntityNileTable())); }
public void registerRenderThings() { TileEntitySpecialRenderer render = new RenderElderFurnace(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElderFurnace.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(UtilModule.ElderFurnace), new ItemRenderElderFurnace(render, new TileEntityElderFurnace())); TileEntitySpecialRenderer render2 = new RenderPylonCrystal(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPylonCrystal.class, render2); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(UtilModule.PylonCrystal), new ItemRenderPylonCrystal(render2, new TileEntityPylonCrystal())); TileEntitySpecialRenderer render3 = new RenderResearchTable(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityResearchTable.class, render3); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(UtilModule.ResearchTable), new ItemRenderResearchTable(render3, new TileEntityResearchTable())); TileEntitySpecialRenderer render4 = new RenderStabiliserMatrix(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStabiliserMatrix.class, render4); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(UtilModule.StabiliserMatrix), new ItemRenderStabiliserMatrix(render4, new TileEntityStabiliserMatrix())); }
private TileEntityRenderer() { this.field_76966_m.put(TileEntitySign.class, new TileEntitySignRenderer()); this.field_76966_m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); this.field_76966_m.put(TileEntityPiston.class, new TileEntityRendererPiston()); this.field_76966_m.put(TileEntityChest.class, new TileEntityChestRenderer()); this.field_76966_m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); this.field_76966_m.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable()); this.field_76966_m.put(TileEntityEndPortal.class, new RenderEndPortal()); this.field_76966_m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); this.field_76966_m.put(TileEntitySkull.class, new TileEntitySkullRenderer()); Iterator var1 = this.field_76966_m.values().iterator(); while(var1.hasNext()) { TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next(); var2.func_76893_a(this); } }
@Override public void addBakedQuads(@Nonnull TileEntitySpecialRenderer<?> conduitBundleRenderer, @Nonnull IConduitBundle bundle, @Nonnull IConduit.WithDefaultRendering conduit, float brightness, @Nonnull BlockRenderLayer layer, List<BakedQuad> quads) { Collection<CollidableComponent> components = conduit.getCollidableComponents(); transmissionScaleFactor = conduit.getTransmitionGeometryScale(); for (CollidableComponent component : components) { if (renderComponent(component)) { float selfIllum = Math.max(brightness, conduit.getSelfIlluminationForState(component)); final TextureAtlasSprite transmitionTextureForState = conduit.getTransmitionTextureForState(component); if (layer != null && isNSEWUD(component.dir) && transmitionTextureForState != null) { Vector4f color = conduit.getTransmitionTextureColorForState(component); addTransmissionQuads(transmitionTextureForState, color, conduit, component, selfIllum, quads); } TextureAtlasSprite tex = conduit.getTextureForState(component); if (tex == null) { tex = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite(); } addConduitQuads(bundle, conduit, tex, component, selfIllum, layer, quads); } } }
@Override public void renderDynamicEntity(@Nonnull TileEntitySpecialRenderer conduitBundleRenderer, @Nonnull IConduitBundle te, @Nonnull IConduit.WithDefaultRendering conduit, double x, double y, double z, float partialTick, float worldLight) { Collection<CollidableComponent> components = conduit.getCollidableComponents(); transmissionScaleFactor = conduit.getTransmitionGeometryScale(); for (CollidableComponent component : components) { if (renderComponent(component)) { float selfIllum = Math.max(worldLight, conduit.getSelfIlluminationForState(component)); final TextureAtlasSprite transmitionTextureForState = conduit.getTransmitionTextureForState(component); if (isNSEWUD(component.dir) && transmitionTextureForState != null) { Vector4f color = conduit.getTransmitionTextureColorForState(component); renderTransmissionDynamic(conduit, transmitionTextureForState, color, component, selfIllum); } TextureAtlasSprite tex = conduit.getTextureForState(component); if (tex == null) { tex = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite(); } renderConduitDynamic(tex, conduit, component, selfIllum); } } }
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) { TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityBanner.class); if (!(tileentityspecialrenderer instanceof TileEntityBannerRenderer)) { return null; } else { if (tileentityspecialrenderer.getEntityClass() == null) { tileentityspecialrenderer = new TileEntityBannerRenderer(); tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); } if (!Reflector.TileEntityBannerRenderer_bannerModel.exists()) { Config.warn("Field not found: TileEntityBannerRenderer.bannerModel"); return null; } else { Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityBannerRenderer_bannerModel, modelBase); return tileentityspecialrenderer; } } }
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) { TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnderChest.class); if (!(tileentityspecialrenderer instanceof TileEntityEnderChestRenderer)) { return null; } else { if (tileentityspecialrenderer.getEntityClass() == null) { tileentityspecialrenderer = new TileEntityEnderChestRenderer(); tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); } if (!Reflector.TileEntityEnderChestRenderer_modelChest.exists()) { Config.warn("Field not found: TileEntityEnderChestRenderer.modelChest"); return null; } else { Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnderChestRenderer_modelChest, modelBase); return tileentityspecialrenderer; } } }
public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) { TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnchantmentTable.class); if (!(tileentityspecialrenderer instanceof TileEntityEnchantmentTableRenderer)) { return null; } else { if (tileentityspecialrenderer.getEntityClass() == null) { tileentityspecialrenderer = new TileEntityEnchantmentTableRenderer(); tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); } if (!Reflector.TileEntityEnchantmentTableRenderer_modelBook.exists()) { Config.warn("Field not found: TileEntityEnchantmentTableRenderer.modelBook"); return null; } else { Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnchantmentTableRenderer_modelBook, modelBase); return tileentityspecialrenderer; } } }
public static void renderTileItem(Item item, int metadata) { Class<? extends TileEntity> tileClass = tileItemMap.get(Pair.of(item, metadata)); if (tileClass != null) { TileEntitySpecialRenderer<?> r = TileEntityRendererDispatcher.instance.getSpecialRendererByClass(tileClass); if (r != null) { r.renderTileEntityAt(null, 0, 0, 0, 0, -1); } } }
public static void init(Class<?> clazz) { AlchemyModLoader.checkState(); Listener listener = clazz.getAnnotation(Listener.class); if (listener != null) for (Listener.Type type : listener.value()) type.getEventBus().register(clazz); if (Always.isClient()) { Texture texture = clazz.getAnnotation(Texture.class); if (texture != null) if (texture.value() != null) for (String res : texture.value()) texture_set.add(res); else AlchemyRuntimeException.onException(new NullPointerException(clazz + " -> @Texture.value()")); Render render = clazz.getAnnotation(Render.class); if (render != null) if (render.value() != null) { if (Tool.isSubclass(TileEntity.class, render.value()) && Tool.isSubclass(TileEntitySpecialRenderer.class, clazz)) try { ClientRegistry.bindTileEntitySpecialRenderer(render.value(), (TileEntitySpecialRenderer) clazz.newInstance()); } catch (Exception e) { AlchemyRuntimeException.onException(e); } else AlchemyRuntimeException.onException(new RuntimeException( "Can't bind Render: " + render.value().getName() + " -> " + clazz.getName())); } else AlchemyRuntimeException.onException(new NullPointerException(clazz + " -> @Render.value()")); } }
@Override public void registerRenderThings(){ //オーバーレイブロックレンダ― RenderingRegistry.registerBlockHandler(new OverlayBlockRender()); //粘土るつぼレンダ― TileEntitySpecialRenderer clayCrucibleSpecialRender = new ClayCrucibleSpecialRender(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityClayCrucible.class,clayCrucibleSpecialRender); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AntiMatterModRegistry.clayCrucible), new ItemRenderClayCrucibles(clayCrucibleSpecialRender,new TileEntityClayCrucible())); ClientRegistry.bindTileEntitySpecialRenderer(TileMultiController.class, new MultiControllerTileRender()); ClientRegistry.bindTileEntitySpecialRenderer(TileBasicTank.class, new RenderTileTank()); RenderingRegistry.registerBlockHandler(new renderMarker()); //土かまどレンダー ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySatStove.class,new SatStoveSpecialRender()); //レンチ関係 MinecraftForge.EVENT_BUS.register(new RenderWrenchSelectionBox()); ClientRegistry.registerKeyBinding(wrenchSetting); MinecraftForge.EVENT_BUS.register(new WrenchKeyEvent()); FMLCommonHandler.instance().bus().register(new WrenchKeyEvent()); RenderingRegistry.registerEntityRenderingHandler(EntityDeveloperBoss.class, new RenderDeveloperBoss()); //MinecraftForgeClient.registerItemRenderer(AntiMatterModRegistry.hammer_01, new ToolDamageRender()); ClientRegistry.bindTileEntitySpecialRenderer(TileMarker.class, new RenderMarker()); }
@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); }
public TileEntityRegistration() { super(RegTileEntity.class, "TileEntity"); this.setLoadStage(LoadStage.INIT); if(SideHelper.isClient()) { this.addWork(HasRender.class, new PostWork<HasRender, Class<? extends TileEntity>>() { @Override @SideOnly(Side.CLIENT) public void invoke(HasRender anno, Class<? extends TileEntity> obj) throws Exception { ClientRegistry.bindTileEntitySpecialRenderer(obj, (TileEntitySpecialRenderer) helper.getFieldFromClass(obj, RegTileEntity.Render.class)); } }); } }
@Override public void registerClientStuff() { TileEntitySpecialRenderer energyCubeSpecialRenderer = new KC2EnergyCubeTileEntityRenderer(); TileEntitySpecialRenderer hardenedEnergyCubeSpecialRenderer = new HardenedKineticEnergyCubeTileEntityRenderer(); ClientRegistry.bindTileEntitySpecialRenderer(KineticEnergyCubeTileEntity.class, energyCubeSpecialRenderer); ClientRegistry.bindTileEntitySpecialRenderer(HardenedKineticEnergyCubeTileEntity.class, hardenedEnergyCubeSpecialRenderer); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(KinetiCraft2Blocks.kineticEnergyCube), new KC2EnergyCubeTileEntityItemRenderer(energyCubeSpecialRenderer, new KineticEnergyCubeTileEntity())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(KinetiCraft2Blocks.hardenedKineticEnergyCube), new KC2EnergyCubeTileEntityItemRenderer(energyCubeSpecialRenderer, new HardenedKineticEnergyCubeTileEntity())); }
public static void protectTESRs() { IdentityHashMap<TileEntitySpecialRenderer, TileEntitySpecialRenderer> cache=new IdentityHashMap<TileEntitySpecialRenderer, TileEntitySpecialRenderer>(); Map<Class, TileEntitySpecialRenderer> map=TileEntityRendererDispatcher.instance.mapSpecialRenderers; for(Class c:map.keySet()) { final TileEntitySpecialRenderer tesr=map.get(c); if(!cache.containsKey(tesr)) { cache.put(tesr, new TileEntitySpecialRenderer() { @Override public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { tesr.renderTileEntityAt(p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); } @Override public void func_147497_a(TileEntityRendererDispatcher p_147497_1_) { tesr.func_147497_a(p_147497_1_); } @Override public void func_147496_a(World p_147496_1_) { tesr.func_147496_a(p_147496_1_); } @Override public FontRenderer func_147498_b() { return tesr.func_147498_b(); } }); } map.remove(c); map.put(c, cache.get(tesr)); } }
@SideOnly(Side.CLIENT) public void registerRendering(ISimpleBlockRenderingHandler blockRenderer, TileEntitySpecialRenderer tileRenderer) { if (blockRenderer != null) { renderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderID, blockRenderer); } if (tileRenderer != null) { ClientRegistry.bindTileEntitySpecialRenderer(tileEntityClass, tileRenderer); } }
@Override public void registerRenderThings() { //Campfire TileEntitySpecialRenderer render = new RenderCampfire(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCampfire.class, render); }
@Override public void registerRenderStuff(){ // RenderingRegistry.registerEntityRenderingHandler(EntityTrilobite.class, new RenderTrilobite()); RenderingRegistry.registerEntityRenderingHandler(EntityCompsognathus.class, new RenderCompsognathus()); RenderingRegistry.registerEntityRenderingHandler(EntityCarnotaurus.class, new RenderCarnotaurus()); RenderingRegistry.registerEntityRenderingHandler(EntityVelociraptor.class, new RenderVelociraptor()); RenderingRegistry.registerEntityRenderingHandler(EntityCoelophysis.class, new RenderCeolophysis()); RenderingRegistry.registerEntityRenderingHandler(EntitySpinosaurus.class, new RenderSpinosaurus()); for (int i = 0; i < EnumFossilSkeleton.values().length; i++) { MinecraftForgeClient.registerItemRenderer(EnumFossilSkeleton.values()[i].fossilItem, (IItemRenderer)new ItemRendererFossil(new ModelCompsognathus(), EnumFossilSkeleton.values()[i].name, false)); MinecraftForgeClient.registerItemRenderer(EnumFossilSkeleton.values()[i].fossilBrokenItem, (IItemRenderer)new ItemRendererFossil(new ModelCompsognathus(), EnumFossilSkeleton.values()[i].name, true)); } TileEntitySpecialRenderer render = new RenderTimeRift(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTimeRift.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.timeRift_nowhere),new ItemRenderTimeRift(render, new TileEntityTimeRift())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.timeRift_cretaceous),new ItemRenderTimeRift(render, new TileEntityTimeRift())); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAmber.class, new RenderAmber()); TileEntitySpecialRenderer render1 = new RenderCleaningTable(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCleaningTable.class, render1); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.cleaning_Table_Off),new ItemRenderCleaningTable(render1, new TileEntityCleaningTable())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.cleaning_Table_On),new ItemRenderCleaningTable(render1, new TileEntityCleaningTable())); }
@SideOnly(Side.CLIENT) public void renderEntity(IGuiLexiconEntry gui, TileEntity entity, int x, int y, int scale, float rotation) { entity.setWorldObj(Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().theWorld : null); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glPushMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glTranslatef(x, y, 75); GL11.glRotatef(180F, 0.0F, 0.25F, 1.0F); GL11.glRotatef(rotation, 0, 1f, 0); GL11.glRotatef(rotation, 0.0F, 1F, 0.0F); GL11.glTranslatef(20,0,0); GL11.glScalef(-scale, scale, scale); GL11.glTranslatef(0, 0, 0); GL11.glRectf(1, 1, 10, 10); RenderHelper.enableStandardItemLighting(); RenderManager.instance.playerViewY = 180.0F; TileEntitySpecialRenderer render = TileEntityRendererDispatcher.instance.getSpecialRenderer(te); if(render != null) render.renderTileEntityAt(entity, 0, 0, 0, 1); GL11.glPopMatrix(); RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); if(relativeMouseX >= x - width * scale / 2 - 10 && relativeMouseY >= y - height * scale - 20 && relativeMouseX <= x + width * scale / 2 + 10 && relativeMouseY <= y + 20) tooltipEntity = true; }
public void register3DItem(BlockContainer theBlock, TileEntitySpecialRenderer renderer) { try { MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(theBlock), new GenericBlockItemRenderer(renderer, theBlock.createNewTileEntity(null, 0))); } catch (Exception e) { e.printStackTrace(); } }
@Override public void registerRenderInfo(){ //IronDeathSpikes TileEntitySpecialRenderer render = new RenderIronDeathSpikes(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityIronDeathSpikes.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.deathSpikes),new ItemRendererIronDeathSpikes(render, new TileEntityIronDeathSpikes())); }
public ItemRenderTileEntity(TileEntitySpecialRenderer renderer, T tile) { this.renderer = renderer; this.tile = tile; if(tile.getWorldObj() == null) { tile.setWorldObj(FAKE_WORLD); } }
public void registerRenderer(int metadata, TileEntity tile, TileEntitySpecialRenderer renderer) { RenderInfo info = new RenderInfo(); info.renderer = renderer; info.tile = tile; renderers.put(metadata, info); if(tile.getWorldObj() == null) { tile.setWorldObj(FAKE_WORLD); } }
public void registerRenderThings(){ //Gem Fuser Render TileEntitySpecialRenderer render = new RenderGemFuser(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGemFuser.class, render); //Mystic Infuser Render TileEntitySpecialRenderer render2 = new RenderMysticInfuser(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMysticInfuser.class, render2); }
public void registerRenderThings() { //GlassLamp TileEntitySpecialRenderer renderGlassLamp = new RenderGlassLamp(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGlassLamp.class, renderGlassLamp); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.glassLamp), new ItemRenderGlassLamp(renderGlassLamp, new TileEntityGlassLamp())); //IlluminatingOrb TileEntitySpecialRenderer renderIllOrb = new RenderGlassLamp(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityIlluminatingOrb.class, renderIllOrb); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.illuminatingOrbBlock), new ItemRenderIlluminatingOrb(renderIllOrb, new TileEntityGlassLamp())); }
@SideOnly(Side.CLIENT) public void registerRendering(ISimpleBlockRenderingHandler blockRenderer, TileEntitySpecialRenderer tileRenderer){ if(blockRenderer != null){ renderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(renderID, blockRenderer); } if(tileRenderer != null){ ClientRegistry.bindTileEntitySpecialRenderer(tileEntityClass, tileRenderer); } }
public static void renderTick(RenderWorldLastEvent event) { RenderGlobal renderContext = event.context; float ptt = event.partialTicks; for (Map.Entry<Point3D, BlockWithData> entry : lockCache.entrySet()) { Block block = entry.getValue().block; Point3D point = entry.getKey(); TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(point.getX(), point.getY(), point.getZ()); if (block == null) return; if (block.renderAsNormalBlock()) { RenderBlocks.getInstance().renderStandardBlock(block, point.getX(), point.getY(), point.getZ()); } else { if (block.getRenderType() == -1) { if (tile != null) { TileEntitySpecialRenderer renderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(tile); if (renderer != null) renderer.renderTileEntityAt(tile, point.getX(), point.getY(), point.getZ(), ptt); } } else { Tessellator.instance.startDrawingQuads(); //RenderingRegistry.instance().renderWorldBlock(RenderBlocks.getInstance(), Minecraft.getMinecraft().theWorld, point.getX(), point.getY(), point.getZ(), block, block.getRenderType()); System.err.println("WORLD: " + Minecraft.getMinecraft().theWorld); RenderBlocks.getInstance().blockAccess = Minecraft.getMinecraft().theWorld; RenderBlocks.getInstance().renderBlockByRenderType(block, point.getX(), point.getY(), point.getZ()); Tessellator.instance.draw(); } } } }
public void registerRenderThings(){ //Obsidian Table TileEntitySpecialRenderer render = new RenderObsidianTable(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityObsidianTable.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(LetsModNG.blockObsidianTable), new ItemRenderObsidianTable(render, new TileEntityObsidianTable())); //Entities RenderingRegistry.registerEntityRenderingHandler(EntityCyclops.class, new RenderCyclops(new ModelCyclops(), 0.3F)); }
@Override public void renderInfomation(){ /** //The Large Stone Column TileEntitySpecialRenderer largeColumnStone = new TileEntityLargeColumnRenderer(KimptonCore.largeColumnStone.getUnlocalizedName().substring(5)); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlock.class, largeColumnStone); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(KimptonCore.largeColumnStone), new HandEntityRenderer(largeColumnStone, new TileEntityBlock())); //The Large Brick Column TileEntitySpecialRenderer largeColumnBrick = new TileEntityLargeColumnRenderer(KimptonCore.largeColumnBrick.getUnlocalizedName().substring(5)); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlock.class, largeColumnBrick); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(KimptonCore.largeColumnBrick), new HandEntityRenderer(largeColumnBrick, new TileEntityBlock())); */ /* Tile Entity Renderer Columns : * INDEX * 1 = ModelLargeColumn * 2 = ModelMediumColumn * 3 = ModelSmallColumn */ //All Large Columns TileEntitySpecialRenderer allLarge = new TileEntityRendererLargeColumn(KimptonCore.allLarge.getUnlocalizedName().substring(5), 1); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlock.class, allLarge); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(KimptonCore.allLarge), new HandEntityRenderer(allLarge, new TileEntityBlock())); }
public TileEntitySpecialRenderer func_76951_a(Class p_76951_1_) { TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.field_76966_m.get(p_76951_1_); if(var2 == null && p_76951_1_ != TileEntity.class) { var2 = this.func_76951_a(p_76951_1_.getSuperclass()); this.field_76966_m.put(p_76951_1_, var2); } return var2; }
public void func_76949_a(TileEntity p_76949_1_, double p_76949_2_, double p_76949_4_, double p_76949_6_, float p_76949_8_) { TileEntitySpecialRenderer var9 = this.func_76956_b(p_76949_1_); if(var9 != null) { try { var9.func_76894_a(p_76949_1_, p_76949_2_, p_76949_4_, p_76949_6_, p_76949_8_); } catch (Throwable var13) { CrashReport var11 = CrashReport.func_85055_a(var13, "Rendering Tile Entity"); CrashReportCategory var12 = var11.func_85058_a("Tile Entity Details"); p_76949_1_.func_85027_a(var12); throw new ReportedException(var11); } } }
public void func_76955_a(World p_76955_1_) { this.field_76957_f = p_76955_1_; Iterator var2 = this.field_76966_m.values().iterator(); while(var2.hasNext()) { TileEntitySpecialRenderer var3 = (TileEntitySpecialRenderer)var2.next(); if(var3 != null) { var3.func_76896_a(p_76955_1_); } } }
@Override public void registerRenderers() { renderers.put(TileEntityControlledSpawner.class, new TileEntityMobSpawnerRenderer()); for (TileEntitySpecialRenderer tesr : renderers.values()) { tesr.setTileEntityRenderer(TileEntityRenderer.instance); } TileEntityRenderer.instance.specialRendererMap.putAll(renderers); }