public static void resetDisplayListModels() { if (needResetModels) { needResetModels = false; SMCLog.info("Reset model renderers"); for (Object render : mc.getRenderManager().getEntityRenderMap().values()) { if (render instanceof RendererLivingEntity) { RendererLivingEntity rendererlivingentity = (RendererLivingEntity)render; resetDisplayListModel(rendererlivingentity.getMainModel()); } } } }
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z) { this.entity = entity; this.renderer = renderer; this.x = x; this.y = y; this.z = z; }
private void registerClientSide(FMLPreInitializationEvent event) { if (event.getSide().isClient()) { optiFineWarn = FMLClientHandler.instance().hasOptifine(); ClientProxy.registerRenderInformation(); RendererLivingEntity.NAME_TAG_RANGE_SNEAK = nametagrange; RendererLivingEntity.NAME_TAG_RANGE = nametagrange; MinecraftForge.EVENT_BUS.register(new RivalRebelsSoundEventHandler()); MinecraftForgeClient.registerItemRenderer(RivalRebels.roddisk, new RodDiskRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.plasmacannon, new PlasmaCannonRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.einsten, new AstroBlasterRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.hydrod, new HydrogenRodRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.redrod, new RedstoneRodRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.nuclearelement, new NuclearRodRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.emptyrod, new EmptyRodRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.reactor.getItemDropped(1, null, 1), new ReactorRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.loader.getItemDropped(1, null, 1), new LoaderRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.controller.getItemDropped(1, null, 1), new LaptopRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.rpg, new RocketLauncherRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.binoculars, new BinocularsRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.tesla, new TeslaRenderer()); // MinecraftForgeClient.registerItemRenderer(RivalRebels.nikolatesla.itemID, new TeslaRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.battery, new BatteryRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.flamethrower, new FlamethrowerRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.fuel, new GasRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.roda, new RodaRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.hackm202, new HackRocketLauncherRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.seekm202, new SeekRocketLauncherRenderer()); MinecraftForgeClient.registerItemRenderer(RivalRebels.rocket, new RocketRenderer()); rrro = new RivalRebelsRenderOverlay(); RenderLibrary rl = new RenderLibrary(); rl.init(); MinecraftForge.EVENT_BUS.register(rrro); } }
@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); }
/** * Renderer's getMainModel() must return a model implementing IModelBiped */ public LayerGenericHeldItem(RendererLivingEntity<?> modelBase) { this.modelBase = modelBase; if (!(this.modelBase.getMainModel() instanceof IModelBiped)) { throw new IllegalArgumentException("Model must implement IModelBiped!"); } }
@SubscribeEvent public void render(RenderPlayerEvent.Pre e) { ModelPlayer model; if (!models.containsKey(e.entityPlayer.func_146103_bH().getName())) { model = new ModelPlayer(); model.setUpCustom(e.entityPlayer.func_146103_bH().getName()); models.put(e.entityPlayer.func_146103_bH().getName(), model); } else { model = models.get(e.entityPlayer.func_146103_bH().getName()); } ObfuscationReflectionHelper.setPrivateValue(RendererLivingEntity.class, e.renderer, model, "mainModel", "field_77045_g"); ObfuscationReflectionHelper.setPrivateValue(RenderPlayer.class, e.renderer, model, "modelBipedMain", "field_77109_a"); }
@Override public void doRender(EntityLivingBase ent, double par2, double par4, double par6, float par8, float par9) { EntityXanafiedMob xana = (EntityXanafiedMob) ent; if (xana != null && xana.infectedMob != null) { RendererLivingEntity render = (RendererLivingEntity) RenderManager.instance.getEntityRenderObject(xana.infectedMob); render.doRender(xana, par2, par4, par6, par8, par9); } else super.doRender(ent, par2, par4, par6, par8, par9); }
public LayerVillagerArmor(RendererLivingEntity<?> rendererIn) { super(rendererIn); }
public LayerArrow(RendererLivingEntity p_i46124_1_) { this.field_177168_a = p_i46124_1_; }
public LayerBipedArmor(RendererLivingEntity<?> rendererIn) { super(rendererIn); }
public LayerHeldItem(RendererLivingEntity<?> livingEntityRendererIn) { this.livingEntityRenderer = livingEntityRendererIn; }
public LayerArmorBase(RendererLivingEntity<?> rendererIn) { this.renderer = rendererIn; this.initArmor(); }
@SubscribeEvent public void RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z) { }
public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer) { this.entity = entity; this.renderer = renderer; }
@SideOnly(Side.CLIENT) @SubscribeEvent(priority = EventPriority.HIGHEST) public void onRenderSpecials(RenderLivingEvent.Specials.Pre event) { Iterator<Entry<String, MorphInfoClient>> ite = Morph.proxy.tickHandlerClient.playerMorphInfo.entrySet().iterator(); while(ite.hasNext()) { Entry<String, MorphInfoClient> e = ite.next(); if(e.getValue().nextState.entInstance == event.entity || e.getValue().prevState != null && e.getValue().prevState.entInstance == event.entity) { if(e.getValue().prevState != null && e.getValue().prevState.entInstance instanceof EntityPlayer && !((EntityPlayer)e.getValue().prevState.entInstance).getCommandSenderName().equals(e.getKey())) { event.setCanceled(true); } EntityPlayer player = event.entity.worldObj.getPlayerEntityByName(e.getKey()); if(player != null && !(e.getValue().nextState.entInstance instanceof EntityPlayer && ((EntityPlayer)e.getValue().nextState.entInstance).getCommandSenderName().equals(e.getKey()))) { if(Morph.config.getSessionInt("showPlayerLabel") == 1) { if(e.getValue().nextState.entInstance instanceof EntityPlayer && !((EntityPlayer)e.getValue().nextState.entInstance).getCommandSenderName().equals(e.getKey())) { event.setCanceled(true); } RenderPlayer rend = (RenderPlayer)RenderManager.instance.getEntityRenderObject(player); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); if(Minecraft.isGuiEnabled() && player != Minecraft.getMinecraft().thePlayer && !player.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && player.riddenByEntity == null) { float f = 1.6F; float f1 = 0.016666668F * f; double d3 = player.getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer); float f2 = player.isSneaking() ? RendererLivingEntity.NAME_TAG_RANGE_SNEAK : RendererLivingEntity.NAME_TAG_RANGE; if(d3 < (double)(f2 * f2)) { String s = player.func_145748_c_().getFormattedText(); rend.func_96449_a(player, event.x, event.y, event.z, s, f1, d3); } } } } break; } } }
public Pre(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
public Post(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }
public Specials(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); }