net.minecraft.client.renderer.entity.RenderManager Java Examples

The following examples show how to use net.minecraft.client.renderer.entity.RenderManager. 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: IronChestFinder.java    From ehacks-pro with GNU General Public License v3.0 8 votes vote down vote up
@Override
public void onWorldRender(RenderWorldLastEvent event) {
    try {
        for (Object o : Wrapper.INSTANCE.world().loadedTileEntityList) {
            if (Class.forName("cpw.mods.ironchest.TileEntityIronChest").isInstance(o)) {
                TileEntity chest = (TileEntity) o;
                double renderX = chest.xCoord - RenderManager.renderPosX;
                double renderY = chest.yCoord - RenderManager.renderPosY;
                double renderZ = chest.zCoord - RenderManager.renderPosZ;
                GL11.glPushMatrix();
                GL11.glTranslated(renderX, renderY, renderZ);
                GL11.glColor3f(1.0f, 1.0f, 0.0f);
                AltAxisAlignedBB boundingBox = AltAxisAlignedBB.getBoundingBox(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
                GL11.glColor4f(0.0f, 1.0f, 1.0f, 0.1f);
                GLUtils.startDrawingESPs(boundingBox, 0.3f, 0.8f, 1.0f);
                GL11.glPopMatrix();
            }
        }
    } catch (Exception e) {

    }
}
 
Example #2
Source File: TileEntityWrathCageRenderer.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 6 votes vote down vote up
public static void renderMob(WrathSpawnerLogic spawnLogic, double par1, double y, double par5, float par7) {
    Entity entity = spawnLogic.getEntityForRender();

    if (entity != null) {
        entity.setWorld(spawnLogic.getSpawnerWorld());
        float f1 = 0.4375F;
        if (spawnLogic.getEntityNameToSpawn().equals("Ghast"))
            f1 = 0.1F;
        else if (spawnLogic.getEntityNameToSpawn().equals("Slime") || spawnLogic.getEntityNameToSpawn().equals("ThaumSlime"))
            f1 = 0.4F;
        else if (spawnLogic.getEntityNameToSpawn().equals("Enderman"))
            f1 = 0.3F;
        GL11.glTranslatef(0.0F, 0.4F, 0.0F);
        if (!spawnLogic.getSpawnerWorld().isBlockIndirectlyGettingPowered(spawnLogic.getSpawnerX(), spawnLogic.getSpawnerY(), spawnLogic.getSpawnerZ()))
            GL11.glRotatef((float) (spawnLogic.field_98284_d + (spawnLogic.field_98287_c - spawnLogic.field_98284_d) * (double) par7) * 10.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
        GL11.glTranslatef(0.0F, -0.4F, 0.0F);
        GL11.glScalef(f1, f1, f1);
        entity.setLocationAndAngles(par1, y, par5, 0.0F, 0.0F);
        RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7);
    }
}
 
Example #3
Source File: RenderGuard.java    From ToroQuest with GNU General Public License v3.0 6 votes vote down vote up
public RenderGuard(RenderManager renderManagerIn) {
	super(renderManagerIn, new ModelGuard(), 0.5F);

	LayerRenderer<?> layerrenderer = (LayerRenderer) this.layerRenderers.get(0);
	defaultModel = (ModelGuard) mainModel;

	addLayer(new LayerHeldItem(this));

	LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
		protected void initArmor() {
			modelLeggings = new ModelZombie(0.5F, true);
			modelArmor = new ModelZombie(1.0F, true);
		}
	};
	addLayer(layerbipedarmor);

	// addLayer(new LayerCape(this));

	this.defaultLayers = Lists.newArrayList(this.layerRenderers);

}
 
Example #4
Source File: RenderUtils.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
public static void renderNameTag(final String string, final double x, final double y, final double z) {
    final RenderManager renderManager = mc.getRenderManager();

    glPushMatrix();
    glTranslated(x - renderManager.renderPosX, y - renderManager.renderPosY, z - renderManager.renderPosZ);
    glNormal3f(0F, 1F, 0F);
    glRotatef(-mc.getRenderManager().playerViewY, 0F, 1F, 0F);
    glRotatef(mc.getRenderManager().playerViewX, 1F, 0F, 0F);
    glScalef(-0.05F, -0.05F, 0.05F);
    setGlCap(GL_LIGHTING, false);
    setGlCap(GL_DEPTH_TEST, false);
    setGlCap(GL_BLEND, true);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    final int width = Fonts.font35.getStringWidth(string) / 2;

    Gui.drawRect(-width - 1, -1, width + 1, Fonts.font35.FONT_HEIGHT, Integer.MIN_VALUE);
    Fonts.font35.drawString(string, -width, 1.5F, Color.WHITE.getRGB(), true);

    resetCaps();
    glColor4f(1F, 1F, 1F, 1F);
    glPopMatrix();
}
 
Example #5
Source File: ToroQuestEntityRenders.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public static void registerMageRenderer() {
	RenderingRegistry.registerEntityRenderingHandler(EntityMage.class, new IRenderFactory<EntityMage>() {
		@Override 
		public Render<EntityMage> createRenderFor(RenderManager manager) { 
			return new RenderMage(manager); 
		}
	});
}
 
Example #6
Source File: RenderEntityChopperSeeds.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public RenderEntityChopperSeeds(){
    itemRenderer = new RenderItem(){
        @Override
        public boolean shouldBob(){

            return false;
        };
    };
    itemRenderer.setRenderManager(RenderManager.instance);
}
 
Example #7
Source File: ItemTeleport.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onRender3D(final Render3DEvent event) {
    objectPosition = mc.thePlayer.rayTrace(1000, event.getPartialTicks());

    if(objectPosition.getBlockPos() == null)
        return;

    final int x = objectPosition.getBlockPos().getX();
    final int y = objectPosition.getBlockPos().getY();
    final int z = objectPosition.getBlockPos().getZ();

    if(BlockUtils.getBlock(objectPosition.getBlockPos()).getMaterial() != Material.air) {
        final RenderManager renderManager = mc.getRenderManager();

        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_BLEND);
        glLineWidth(2F);
        glDisable(GL_TEXTURE_2D);
        glDisable(GL_DEPTH_TEST);
        glDepthMask(false);
        RenderUtils.glColor(BlockUtils.getBlock(objectPosition.getBlockPos().up()).getMaterial() != Material.air ? new Color(255, 0, 0, 90) : new Color(0, 255, 0, 90));
        RenderUtils.drawFilledBox(new AxisAlignedBB(x - renderManager.renderPosX, (y + 1) - renderManager.renderPosY, z - renderManager.renderPosZ, x - renderManager.renderPosX + 1D, y + 1.2D - renderManager.renderPosY, z - renderManager.renderPosZ + 1D));
        glEnable(GL_TEXTURE_2D);
        glEnable(GL_DEPTH_TEST);
        glDepthMask(true);
        glDisable(GL_BLEND);

        RenderUtils.renderNameTag(Math.round(mc.thePlayer.getDistance(x, y, z)) + "m", x + 0.5, y + 1.7, z + 0.5);
        GlStateManager.resetColor();
    }
}
 
Example #8
Source File: XRay.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onWorldRender(RenderWorldLastEvent event) {
    if (Wrapper.INSTANCE.world() != null && displayListId != 0) {
        double doubleX = RenderManager.renderPosX;
        double doubleY = RenderManager.renderPosY;
        double doubleZ = RenderManager.renderPosZ;
        GL11.glPushMatrix();
        GL11.glTranslated((-doubleX), (-doubleY), (-doubleZ));
        GL11.glCallList(displayListId);
        GL11.glPopMatrix();
    }
}
 
Example #9
Source File: RenderDroneAI.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public RenderDroneAI(EntityDrone drone){
    this.drone = drone;
    renderItem = new RenderItem();
    renderItem.setRenderManager(RenderManager.instance);
    entityItem = new EntityItem(drone.worldObj);
    update();
}
 
Example #10
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 #11
Source File: EntityBas.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public static void registerRenders() {
	RenderingRegistry.registerEntityRenderingHandler(EntityBas.class, new IRenderFactory<EntityBas>() {
		@Override
		public Render<EntityBas> createRenderFor(RenderManager manager) {
			return new RenderBas(manager);
		}
	});
}
 
Example #12
Source File: ClientEventHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private void setRenderHead(EntityLivingBase entity, boolean setRender){
    if(entity.getEquipmentInSlot(4) != null && entity.getEquipmentInSlot(4).getItem() == Itemss.pneumaticHelmet && (Config.useHelmetModel || DateEventHandler.isIronManEvent())) {
        Render renderer = RenderManager.instance.getEntityRenderObject(entity);
        if(renderer instanceof RenderBiped) {
            ((RenderBiped)renderer).modelBipedMain.bipedHead.showModel = setRender;
        }
    }
}
 
Example #13
Source File: SearchUpgradeHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void render3D(float partialTicks){
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(false);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderManager.instance.renderEngine.bindTexture(Textures.GLOW_RESOURCE);
    //  mc.func_110434_K().func_110577_a(Textures.GLOW_RESOURCE);
    for(Map.Entry<EntityItem, Integer> entry : searchedItems.entrySet()) {
        EntityItem item = entry.getKey();
        float height = MathHelper.sin((item.age + partialTicks) / 10.0F + item.hoverStart) * 0.1F + 0.2F;
        RenderSearchItemBlock.renderSearch(item.lastTickPosX + (item.posX - item.lastTickPosX) * partialTicks, item.lastTickPosY + (item.posY - item.lastTickPosY) * partialTicks + height, item.lastTickPosZ + (item.posZ - item.lastTickPosZ) * partialTicks, entry.getValue(), totalSearchedItemCount);
    }
    for(int i = 0; i < searchedBlocks.size(); i++) {
        if(!searchedBlocks.get(i).renderSearchBlock(totalSearchedItemCount)) {
            searchedBlocks.remove(i);
            i--;
        }
    }
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
 
Example #14
Source File: ModelChargingStation.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void renderStatic(float size, TileEntity te){
    renderModel(size);
    if(te instanceof TileEntityChargingStation) {
        TileEntityChargingStation tile = (TileEntityChargingStation)te;
        if(tile.getUpgrades(ItemMachineUpgrade.UPGRADE_DISPENSER_DAMAGE) > 0) {
            RenderManager.instance.renderEngine.bindTexture(Textures.MODEL_CHARGING_STATION_PAD);
            chargePad.renderModel(size);
        }
        if(tile.getStackInSlot(TileEntityChargingStation.CHARGE_INVENTORY_INDEX) != null) {
            float scaleFactor = 0.7F;

            EntityItem ghostEntityItem = new EntityItem(tile.getWorldObj());
            ghostEntityItem.hoverStart = 0.0F;
            ghostEntityItem.setEntityItemStack(tile.getStackInSlot(TileEntityChargingStation.CHARGE_INVENTORY_INDEX));

            GL11.glTranslated(0, 1, 0);
            GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
            GL11.glScalef(1.0F, -1F, -1F);

            boolean fancySetting = RenderManager.instance.options.fancyGraphics;
            RenderManager.instance.options.fancyGraphics = true;
            customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
            RenderManager.instance.options.fancyGraphics = fancySetting;
        }
    }
}
 
Example #15
Source File: RenderAphorismTile.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private int getMaxLineWidth(String[] textList){
    int maxLength = 0;
    for(String string : textList) {
        int stringWidth = RenderManager.instance.getFontRenderer().getStringWidth(string);
        if(stringWidth > maxLength) {
            maxLength = stringWidth;
        }
    }
    return maxLength;
}
 
Example #16
Source File: RenderVillageLord.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public RenderVillageLord(RenderManager renderManagerIn) {
	super(renderManagerIn, new ModelVillageLord(), 0.5F);
	LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) {
		protected void initArmor() {
			this.modelLeggings = new ModelSentry(0.5F, true);
			this.modelArmor = new ModelSentry(1.0F, true);
		}
	};
	this.addLayer(layerbipedarmor);
}
 
Example #17
Source File: ProxyFunctions.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static net.minecraftforge.fml.client.registry.IRenderFactory entityVillagerRenderer(){
	return new net.minecraftforge.fml.client.registry.IRenderFactory(){
		@Override
		public Render createRenderFor(RenderManager manager) {
			return new net.minecraft.client.renderer.entity.RenderVillager(manager);
		}
	};

}
 
Example #18
Source File: RenderTofuMindCore.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public RenderTofuMindCore(RenderManager p_i48864_1_) {
    super(p_i48864_1_, new ModelTofuMindCore(), 0.5F);
    this.addLayer(new LayerGlowEye<>(this, "textures/mob/tofumindcore/tofumindcore_eye.png"));
    this.addLayer(new LayerHeldItem(this) {
        @Override
        public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
            GlStateManager.translate(0.0F, 0.35F, 0.0F);
            super.doRenderLayer(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
        }
    });
}
 
Example #19
Source File: ToroQuestEntityRenders.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
public static void registerMonolithEyeRenderer() {
	RenderingRegistry.registerEntityRenderingHandler(EntityMonolithEye.class, new IRenderFactory<EntityMonolithEye>() {
		@Override 
		public Render<EntityMonolithEye> createRenderFor(RenderManager manager) { 
			return new RenderMonolithEye(manager); 
		}
	});
}
 
Example #20
Source File: RenderGolemHelper.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
public static void renderToolItem(EntityGolemBase golem, ItemStack itemstack, ModelBase mainModel, RenderManager renderManager) {
    GL11.glPushMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    float angle = (float) (0.195 * Math.PI / -1 * ((ModelGolem) mainModel).golemRightArm.rotateAngleX);

    float y = (float) (Math.cos(angle) * 1.15);
    float z = (float) (Math.sin(angle) * 1.15);

    GL11.glTranslatef(-0.25F, y, z * -0.5f);

    GL11.glRotated(angle / Math.PI * 180f, -1, 0, 0);

    float fs = 0.66F;
    GL11.glScalef(fs, fs, fs);

    net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED);
    boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D));

    Item item = itemstack.getItem();
    float f1;

    if (item instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())))
    {
        f1 = 0.5F;
        GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
        f1 *= 0.75F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-f1, -f1, f1);
    }
    else if (item == Items.bow)
    {
        f1 = 0.625F;
        GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
        GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(f1, -f1, f1);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
    }
    else if (item.isFull3D())
    {
        f1 = 0.625F;

        if (item.shouldRotateAroundWhenRendering())
        {
            GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
            GL11.glTranslatef(0.0F, -0.125F, 0.0F);
        }

        GL11.glTranslatef(0.0F, 0.1875F, 0.0F);

        GL11.glScalef(f1, -f1, f1);
        GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
    }
    else
    {
        f1 = 0.375F;
        GL11.glTranslatef(0.25F, 0.1875F, -0.1875F);
        GL11.glScalef(f1, f1, f1);
        GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F);
    }

    float f2;
    int i;
    float f5;

    if (itemstack.getItem().requiresMultipleRenderPasses())
    {
        for (i = 0; i < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++i)
        {
            int j = itemstack.getItem().getColorFromItemStack(itemstack, i);
            f5 = (float)(j >> 16 & 255) / 255.0F;
            f2 = (float)(j >> 8 & 255) / 255.0F;
            float f3 = (float)(j & 255) / 255.0F;
            GL11.glColor4f(f5, f2, f3, 1.0F);

            renderManager.itemRenderer.renderItem(golem, itemstack, i);
        }
    }
    else
    {
        i = itemstack.getItem().getColorFromItemStack(itemstack, 0);
        float f4 = (float)(i >> 16 & 255) / 255.0F;
        f5 = (float)(i >> 8 & 255) / 255.0F;
        f2 = (float)(i & 255) / 255.0F;
        GL11.glColor4f(f4, f5, f2, 1.0F);

        renderManager.itemRenderer.renderItem(golem, itemstack, 0);
    }


    GL11.glScaled(1.0D, 1.0D, 1.0D);

    GL11.glPopMatrix();
}
 
Example #21
Source File: RenderMage.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public RenderMage(RenderManager renderManagerIn) {
	super(renderManagerIn, new ModelMage(), 0.5F);
	this.mageModel = getMainModel();
	addLayer(new LayerHeldItem(this));
}
 
Example #22
Source File: RenderWitherWitch.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
public RenderWitherWitch(RenderManager rm) {
  super(rm, new ModelWitch(0.0F), 0.5F);
  this.witchModel = (ModelWitch) this.mainModel;
  addLayer(new LayerHeldItemWitch(this));
}
 
Example #23
Source File: MixinRenderManger.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Inject(method = "<init>", at = @At("RETURN"))
private void injectEntities(TextureManager renderEngineIn, RenderItem itemRendererIn, CallbackInfo ci) {
    entityRenderMap.put(EntityHamster.class, new RenderHamster((RenderManager) (Object) this));
}
 
Example #24
Source File: EntityWikiTab.java    From IGW-mod with GNU General Public License v2.0 4 votes vote down vote up
public static void drawEntity(Entity entity, int x, int y, float size, float partialTicks){
    //GL11.glEnable(GL11.GL_LIGHTING);
    //x, y, scale, yaw, pitch
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float maxHitboxComponent = Math.max(1, Math.max(entity.width, entity.height));
    int scale = (int)(40 * size / maxHitboxComponent);

    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GL11.glTranslatef(x, y, 50.0F);
    GL11.glScalef(-scale, scale, scale);
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);

    GL11.glRotatef(30, 1, 0, 0);

    GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);

    GL11.glRotatef(-TickHandler.ticksExisted, 0, 1, 0);
    /* GL11.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
     entity.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F;
     entity.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F;
     entity.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F;
     entity.rotationYawHead = entity.rotationYaw;
     entity.prevRotationYawHead = entity.rotationYaw;*/
    GL11.glTranslatef(0.0F, (float)entity.getYOffset(), 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setRenderShadow(false);
    Minecraft.getMinecraft().getRenderManager().playerViewY = 180.0F;
    Minecraft.getMinecraft().getRenderManager().renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
    rendermanager.setRenderShadow(true);
    /* entity.renderYawOffset = f2;
     entity.rotationYaw = f3;
     entity.rotationPitch = f4;
     entity.prevRotationYawHead = f5;
     entity.rotationYawHead = f6;*/
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);

    // GL11.glDisable(GL11.GL_LIGHTING);
}
 
Example #25
Source File: DragonCompanion.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
@InvokeEvent
public void renderPlayer(RenderPlayerEvent event) {
    if (Minecraft.getMinecraft().theWorld == null || !isPurchasedBy(event.getEntity().getUniqueID())) return;

    HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(event.getEntity().getUniqueID());

    if (packageIfReady == null || packageIfReady.getCachedSettings().getCurrentCompanion() != EnumPurchaseType.DRAGON_COMPANION)
        return;

    scale = .1F;
    AbstractClientPlayer player = event.getEntity();

    CustomDragon customDragon = dragonHashMap.computeIfAbsent(event.getEntity(), player1 -> {
        EntityDragon dragon = new EntityDragon(player1.getEntityWorld());
        dragon.setSilent(true);
        return new CustomDragon(dragon, new AnimationState());
    });

    Entity entity = customDragon.dragon;
    RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();

    //Manage pos here
    float partialTicks = event.getPartialTicks();

    double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks;
    double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks;
    double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks;

    GlStateManager.pushMatrix();

    EntityDragon entityDragon = customDragon.dragon;
    AnimationState animationState = customDragon.animationState;
    AnimationPoint current = animationState.getCurrent(player);
    entityDragon.posX = current.x / scale;
    entityDragon.posY = current.y / scale;
    entityDragon.posZ = current.z / scale;

    GlStateManager.translate(-((IMixinRenderManager) renderManager).getPosX(),
        -((IMixinRenderManager) renderManager).getPosY(),
        -((IMixinRenderManager) renderManager).getPosZ());

    GlStateManager.translate(d0 * scale, d1 * scale, d2 * scale);
    GlStateManager.scale(scale, scale, scale);

    renderManager.renderEntitySimple(entity, event.getPartialTicks());
    GlStateManager.popMatrix();
    //render
}
 
Example #26
Source File: BWModel.java    From NOVA-Core with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void render(Optional<RenderManager> entityRenderManager) {
	render(Optional.empty(), entityRenderManager);
}
 
Example #27
Source File: RenderPrimedCharge.java    From EnderZoo with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
@Override
public Render<? super EntityPrimedCharge> createRenderFor(RenderManager manager) {
  return new RenderPrimedCharge(manager);
}
 
Example #28
Source File: RenderUnicorn.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public RenderUnicorn(RenderManager renderManager, ModelBase modelBase) {
	super(renderManager, modelBase, 0.75F);
}
 
Example #29
Source File: RenderElevatorCapsule.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public RenderElevatorCapsule(RenderManager renderManager) {
	super(renderManager);
}
 
Example #30
Source File: RenderHaloInfusionItem.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public RenderHaloInfusionItem(RenderManager renderManager) {
	super(renderManager);
}