当前位置: 首页>>代码示例>>Java>>正文


Java ActiveRenderInfo类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.ActiveRenderInfo的典型用法代码示例。如果您正苦于以下问题:Java ActiveRenderInfo类的具体用法?Java ActiveRenderInfo怎么用?Java ActiveRenderInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ActiveRenderInfo类属于net.minecraft.client.renderer包,在下文中一共展示了ActiveRenderInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderTick

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
@Override
public void renderTick(float partialTicks)
{
    Minecraft.getMinecraft().mcProfiler.startSection("expParticleDraw");
    Minecraft.getMinecraft().renderEngine.bindTexture(ExPTextures.PARTICLES);
    BufferBuilder bb = Tessellator.getInstance().getBuffer();
    GlStateManager.disableAlpha();
    GlStateManager.disableBlend();
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.SOLID).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.CUTOUT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.TRANSLUCENT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    Minecraft.getMinecraft().mcProfiler.endSection();
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:24,代码来源:ParticleEngine.java

示例2: onRenderFog

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
@SubscribeEvent
public void onRenderFog(EntityViewRenderEvent.FogDensity event) {
    if (event.getEntity() instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.getEntity();
        PossessivePlayer possessivePlayer = PossessHandler.get(player);
        if (possessivePlayer != null && (possessivePlayer.getPossessing().canBreatheUnderwater() || possessivePlayer.getPossessing() instanceof EntityGuardian)) {
            if (ActiveRenderInfo.getBlockStateAtEntityViewpoint(ClientEventHandler.MINECRAFT.theWorld, player, (float) event.getRenderPartialTicks()).getMaterial() != Material.WATER) {
                GlStateManager.setFog(GlStateManager.FogMode.EXP);
                event.setDensity(0.125F);
                event.setCanceled(true);
            } else {
                GlStateManager.setFog(GlStateManager.FogMode.EXP);
                event.setDensity(0.02F);
                event.setCanceled(true);
            }
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:19,代码来源:ClientEventHandler.java

示例3: fogColorEvent

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void fogColorEvent(final EntityViewRenderEvent.FogColors event) {
	if (doFog()) {
		final IBlockState block = ActiveRenderInfo.getBlockStateAtEntityViewpoint(event.getEntity().world,
				event.getEntity(), (float) event.getRenderPartialTicks());
		if (block.getMaterial() == Material.LAVA || block.getMaterial() == Material.WATER)
			return;

		final Color color = this.scanner.getFogColor(EnvironState.getWorld(),
				(float) event.getRenderPartialTicks());
		if (color != null) {
			event.setRed(color.red);
			event.setGreen(color.green);
			event.setBlue(color.blue);
		}
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:18,代码来源:FogEffectHandler.java

示例4: render

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
public static void render(double x, double y, double z, Colour colour, double s, double u1, double v1, double u2, double v2) {
    x -= Particle.interpPosX;
    y -= Particle.interpPosY;
    z -= Particle.interpPosZ;

    float par3 = ActiveRenderInfo.getRotationX();
    float par4 = ActiveRenderInfo.getRotationXZ();
    float par5 = ActiveRenderInfo.getRotationZ();
    float par6 = ActiveRenderInfo.getRotationYZ();
    float par7 = ActiveRenderInfo.getRotationXY();

    VertexBuffer b = Tessellator.getInstance().getBuffer();
    b.pos((x - par3 * s - par6 * s), (y - par4 * s), (z - par5 * s - par7 * s)).tex(u2, v2).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
    b.pos((x - par3 * s + par6 * s), (y + par4 * s), (z - par5 * s + par7 * s)).tex(u2, v1).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
    b.pos((x + par3 * s + par6 * s), (y + par4 * s), (z + par5 * s + par7 * s)).tex(u1, v1).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
    b.pos((x + par3 * s - par6 * s), (y - par4 * s), (z + par5 * s - par7 * s)).tex(u1, v2).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:18,代码来源:RenderParticle.java

示例5: func_78481_a

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
private float func_78481_a(float p_78481_1_, boolean p_78481_2_) {
   if(this.field_78532_q > 0) {
      return 90.0F;
   } else {
      EntityPlayer var3 = (EntityPlayer)this.field_78531_r.field_71451_h;
      float var4 = 70.0F;
      if(p_78481_2_) {
         var4 += this.field_78531_r.field_71474_y.field_74334_X * 40.0F;
         var4 *= this.field_78506_S + (this.field_78507_R - this.field_78506_S) * p_78481_1_;
      }

      if(var3.func_110143_aJ() <= 0.0F) {
         float var5 = (float)var3.field_70725_aQ + p_78481_1_;
         var4 /= (1.0F - 500.0F / (var5 + 500.0F)) * 2.0F + 1.0F;
      }

      int var6 = ActiveRenderInfo.func_74584_a(this.field_78531_r.field_71441_e, var3, p_78481_1_);
      if(var6 != 0 && Block.field_71973_m[var6].field_72018_cp == Material.field_76244_g) {
         var4 = var4 * 60.0F / 70.0F;
      }

      return var4 + this.field_78494_N + (this.field_78493_M - this.field_78494_N) * p_78481_1_;
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:EntityRenderer.java

示例6: renderParticles

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
public void renderParticles(EntityPlayer dumbplayer, float partialTicks) {
	float f = ActiveRenderInfo.getRotationX();
	float f1 = ActiveRenderInfo.getRotationZ();
	float f2 = ActiveRenderInfo.getRotationYZ();
	float f3 = ActiveRenderInfo.getRotationXY();
	float f4 = ActiveRenderInfo.getRotationXZ();
	EntityPlayer player = EasyMappings.player();
	if (player != null) {
		Particle.interpPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
		Particle.interpPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
		Particle.interpPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;

		Particle.cameraViewDir = player.getLook(partialTicks);
		//GlStateManager.glTexParameterf(3553, 10242, 10497.0F);
		//GlStateManager.glTexParameterf(3553, 10243, 10497.0F);
		GlStateManager.enableAlpha();
		GlStateManager.enableBlend();
		GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
		//GlStateManager.alphaFunc(GL11.GL_GREATER, 0F);
		GlStateManager.disableCull();

		GlStateManager.depthMask(false);

		Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
		Tessellator tess = Tessellator.getInstance();
		BufferBuilder buffer = tess.getBuffer();
		buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
		for (int i = 0; i < particles.size(); i++) {
			particles.get(i).renderParticle(buffer, player, partialTicks, f, f4, f1, f2, f3);
		}
		tess.draw();

		GlStateManager.enableCull();
		GlStateManager.depthMask(true);
		GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
		GlStateManager.disableBlend();
		//GlStateManager.alphaFunc(516, 0.1F);
	}
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:40,代码来源:ParticleRenderer.java

示例7: onGetFogColor

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
@SubscribeEvent
public void onGetFogColor(EntityViewRenderEvent.FogColors event)
{
    if (event.getEntity() instanceof EntityPlayer)
    {
        EntityPlayer player = (EntityPlayer) event.getEntity();
        World world = player.world;

        int x = MathHelper.floor(player.posX);
        int y = MathHelper.floor(player.posY);
        int z = MathHelper.floor(player.posZ);

        IBlockState stateAtEyes = ActiveRenderInfo.getBlockStateAtEntityViewpoint(world, event.getEntity(), (float) event.getRenderPartialTicks());
        if (stateAtEyes.getMaterial() == Material.LAVA)
        {
            return;
        }

        Vec3d mixedColor;
        if (stateAtEyes.getMaterial() == Material.WATER)
        {
            mixedColor = getFogBlendColorWater(world, player, x, y, z, event.getRenderPartialTicks());
        } else
        {
            mixedColor = getFogBlendColour(world, player, x, y, z, event.getRed(), event.getGreen(), event.getBlue(), event.getRenderPartialTicks());
        }

        event.setRed((float) mixedColor.x);
        event.setGreen((float) mixedColor.y);
        event.setBlue((float) mixedColor.z);
    }
}
 
开发者ID:ProxyNeko,项目名称:Proxys-Lib,代码行数:33,代码来源:FogEventHandler.java

示例8: fogColor

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void fogColor(net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event) {



	Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(event.entity.worldObj, event.entity, (float)event.renderPartialTicks);
	if(block.getMaterial() == Material.water)
		return;

	DimensionProperties properties = DimensionManager.getInstance().getDimensionProperties(event.entity.dimension);
	if(properties != null) {
		float fog = properties.getAtmosphereDensityAtHeight(event.entity.posY);

		if(event.entity.worldObj.provider instanceof IPlanetaryProvider) {
			Vec3 color = event.entity.worldObj.provider.getSkyColor(event.entity, 0f);
			event.red = (float) Math.min(color.xCoord*1.4f,1f);
			event.green = (float) Math.min(color.yCoord*1.4f, 1f);
			event.blue = (float) Math.min(color.zCoord*1.4f, 1f);
		}

		if(endTime > 0) {
			double amt = (endTime - Minecraft.getMinecraft().theWorld.getTotalWorldTime()) / (double)duration;
			if(amt < 0) {
				endTime = 0;
			}
			else
				event.green = event.blue = event.red = (float)amt;

		} else {
			event.red *= fog;
			event.green *= fog;
			event.blue *= fog;
		}
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:37,代码来源:PlanetEventHandler.java

示例9: cleanActiveRenderInfo

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
private void cleanActiveRenderInfo(ItemRenderType renderType) {
    renderInfo[0] = ActiveRenderInfo.rotationX;
    renderInfo[1] = ActiveRenderInfo.rotationXZ;
    renderInfo[2] = ActiveRenderInfo.rotationZ;
    renderInfo[3] = ActiveRenderInfo.rotationYZ;
    renderInfo[4] = ActiveRenderInfo.rotationXY;
    switch (renderType) {
        case ENTITY:
            break;
        case EQUIPPED:
            ActiveRenderInfo.rotationX = 0.85535365F;
            ActiveRenderInfo.rotationXZ = 0.9868404F;
            ActiveRenderInfo.rotationZ = -0.51804453F;
            ActiveRenderInfo.rotationYZ = 0.083717324F;
            ActiveRenderInfo.rotationXY = 0.13822734F;
            break;
        case EQUIPPED_FIRST_PERSON:
            ActiveRenderInfo.rotationX = -0.4186075F;
            ActiveRenderInfo.rotationXZ = 0.99932945F;
            ActiveRenderInfo.rotationZ = -0.90816724F;
            ActiveRenderInfo.rotationYZ = 0.033253096F;
            ActiveRenderInfo.rotationXY = -0.015327567F;
            break;
        case INVENTORY:
            ActiveRenderInfo.rotationX = -0.71445745F;
            ActiveRenderInfo.rotationXZ = 0.9573291F;
            ActiveRenderInfo.rotationZ = 0.69967884F;
            ActiveRenderInfo.rotationYZ = -0.20220716F;
            ActiveRenderInfo.rotationXY = -0.20647818F;
            break;
        case FIRST_PERSON_MAP:
            break;
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:35,代码来源:ItemRenderFamiliar.java

示例10: restoreActiveRenderInfo

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
private void restoreActiveRenderInfo() {
    if(renderInfo[0] != -1) ActiveRenderInfo.rotationX = renderInfo[0];
    if(renderInfo[1] != -1) ActiveRenderInfo.rotationXZ = renderInfo[1];
    if(renderInfo[2] != -1) ActiveRenderInfo.rotationZ = renderInfo[2];
    if(renderInfo[3] != -1) ActiveRenderInfo.rotationYZ = renderInfo[3];
    if(renderInfo[4] != -1) ActiveRenderInfo.rotationXY = renderInfo[4];
    for (int i = 0; i < renderInfo.length; i++) {
        renderInfo[i] = -1;
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:11,代码来源:ItemRenderFamiliar.java

示例11: setRotationX

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
default void setRotationX(float rotationX) {
    try {
        ReflectionHelper.setPrivateValue(ActiveRenderInfo.class, null, rotationX, ACTIVERENDERINFO_ROTATIONX);
    } catch (Exception ex) {
        L.error("setRotationX() failed", ex);
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:8,代码来源:PrivateAccessor.java

示例12: setRotationXZ

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
default void setRotationXZ(float rotationXZ) {
    try {
        ReflectionHelper.setPrivateValue(ActiveRenderInfo.class, null, rotationXZ, ACTIVERENDERINFO_ROTATIONXZ);
    } catch (Exception ex) {
        L.error("setRotationXZ() failed", ex);
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:8,代码来源:PrivateAccessor.java

示例13: setRotationZ

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
default void setRotationZ(float rotationZ) {
    try {
        ReflectionHelper.setPrivateValue(ActiveRenderInfo.class, null, rotationZ, ACTIVERENDERINFO_ROTATIONZ);
    } catch (Exception ex) {
        L.error("setRotationZ() failed", ex);
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:8,代码来源:PrivateAccessor.java

示例14: setRotationYZ

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
default void setRotationYZ(float rotationYZ) {
    try {
        ReflectionHelper.setPrivateValue(ActiveRenderInfo.class, null, rotationYZ, ACTIVERENDERINFO_ROTATIONYZ);
    } catch (Exception ex) {
        L.error("setRotationYZ() failed", ex);
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:8,代码来源:PrivateAccessor.java

示例15: setRotationXY

import net.minecraft.client.renderer.ActiveRenderInfo; //导入依赖的package包/类
default void setRotationXY(float rotationXY) {
    try {
        ReflectionHelper.setPrivateValue(ActiveRenderInfo.class, null, rotationXY, ACTIVERENDERINFO_ROTATIONXY);
    } catch (Exception ex) {
        L.error("setRotationXY() failed", ex);
    }
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:8,代码来源:PrivateAccessor.java


注:本文中的net.minecraft.client.renderer.ActiveRenderInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。