本文整理汇总了Java中net.minecraft.client.renderer.EntityRenderer类的典型用法代码示例。如果您正苦于以下问题:Java EntityRenderer类的具体用法?Java EntityRenderer怎么用?Java EntityRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityRenderer类属于net.minecraft.client.renderer包,在下文中一共展示了EntityRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderQuads
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
boolean flag = (color == -1) && (!stack.isEmpty());
int i = 0;
for (int j = quads.size(); i < j; i++) {
BakedQuad bakedquad = quads.get(i);
int k = color;
if ((flag) && (bakedquad.hasTintIndex())) {
ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable) {
k = TextureUtil.anaglyphColor(k);
}
k |= 0xFF000000;
}
LightUtil.renderQuadColor(renderer, bakedquad, k);
}
}
示例2: renderQuads
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
boolean flag = color == -1 && stack != null;
int i = 0;
for (int j = quads.size(); i < j; ++i)
{
BakedQuad bakedquad = (BakedQuad)quads.get(i);
int k = color;
if (flag && bakedquad.hasTintIndex())
{
k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());
if (EntityRenderer.anaglyphEnable)
{
k = TextureUtil.anaglyphColor(k);
}
k = k | -16777216;
}
this.renderQuad(renderer, bakedquad, k);
}
}
示例3: onEnable
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
@Override
public void onEnable()
{
if(!OpenGlHelper.shadersSupported)
{
wurst.events.add(UpdateListener.class, this);
return;
}
if(!(mc.getRenderViewEntity() instanceof EntityPlayer))
{
setEnabled(false);
return;
}
if(mc.entityRenderer.theShaderGroup != null)
mc.entityRenderer.theShaderGroup.deleteShaderGroup();
mc.entityRenderer.shaderIndex = 19;
mc.entityRenderer.loadShader(EntityRenderer.SHADERS_TEXTURES[19]);
}
示例4: renderHand0
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
if (!Shaders.isShadowPass)
{
Item item = Shaders.itemToRender != null ? Shaders.itemToRender.getItem() : null;
Block block = item instanceof ItemBlock ? ((ItemBlock)item).getBlock() : null;
if (!(item instanceof ItemBlock) || !(block instanceof Block) || block.getBlockLayer() == EnumWorldBlockLayer.SOLID)
{
Shaders.readCenterDepth();
Shaders.beginHand();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
er.renderHand(par1, par2);
Shaders.endHand();
Shaders.isHandRendered = true;
}
}
}
示例5: renderHand0
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
if (!Shaders.isShadowPass)
{
boolean flag = Shaders.isItemToRenderMainTranslucent();
boolean flag1 = Shaders.isItemToRenderOffTranslucent();
if (!flag || !flag1)
{
Shaders.readCenterDepth();
Shaders.beginHand();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Shaders.setSkipRenderHands(flag, flag1);
er.renderHand(par1, par2, true, false, false);
Shaders.endHand();
Shaders.setHandsRendered(!flag, !flag1);
Shaders.setSkipRenderHands(false, false);
}
}
}
示例6: renderLivingLabel
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
* Renders an entity's name above its head
*/
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);
if (d0 <= (double)(maxDistance * maxDistance))
{
boolean flag = entityIn.isSneaking();
float f = this.renderManager.playerViewY;
float f1 = this.renderManager.playerViewX;
boolean flag1 = this.renderManager.options.thirdPersonView == 2;
float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
int i = "deadmau5".equals(str) ? -10 : 0;
for(Friend friend: Wrapper.getFriends().friendsList) {
str.replace(friend.getName(), friend.getAlias());
}
if(Wrapper.getFriends().isFriend(str)) {
str = "\2479" + str;
}
if (entityIn instanceof EntityLivingBase) {
str = str + " \247a" + ((double)Math.round((((EntityLivingBase) entityIn).getHealth() * 100) / 100) / 2);
}
if(!Hacks.findMod(Nametags.class).isEnabled())
EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
}
}
示例7: renderLivingLabel
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
* Renders an entity's name above its head
*/
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);
if (d0 <= (double)(maxDistance * maxDistance))
{
boolean flag = entityIn.isSneaking();
float f = this.renderManager.playerViewY;
float f1 = this.renderManager.playerViewX;
boolean flag1 = this.renderManager.options.thirdPersonView == 2;
float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
int i = "deadmau5".equals(str) ? -10 : 0;
EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
}
}
示例8: setBrightness
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
private int setBrightness(Tessellator tessellator, IBlockAccess blockAccess, int x, int y, int z, Block block) {
int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
tessellator.setBrightness(mb);
float f = 1.0F;
int l = block.colorMultiplier(blockAccess, x, y, z);
float f1 = (l >> 16 & 0xFF) / 255.0F;
float f2 = (l >> 8 & 0xFF) / 255.0F;
float f3 = (l & 0xFF) / 255.0F;
if (EntityRenderer.anaglyphEnable) {
float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f6;
f2 = f4;
f3 = f7;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
return mb;
}
示例9: renderStandardBlock
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public boolean renderStandardBlock(final Block p_147784_1_, final int p_147784_2_, final int p_147784_3_, final int p_147784_4_) {
final int l = p_147784_1_.colorMultiplier(this.blockAccess, p_147784_2_, p_147784_3_, p_147784_4_);
float f = (l >> 16 & 0xFF) / 255.0f;
float f2 = (l >> 8 & 0xFF) / 255.0f;
float f3 = (l & 0xFF) / 255.0f;
if (EntityRenderer.anaglyphEnable) {
final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
f = f4;
f2 = f5;
f3 = f6;
}
f *= 0.75f;
f2 *= 0.75f;
f3 *= 0.75f;
return this.renderStandardBlockWithColorMultiplier(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, f, f2, f3);
}
示例10: renderWorldBlock
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
final Tessellator var8 = Tessellator.instance;
final int i = world.getBlockMetadata(par2, par3, par4);
float f = BlockColor.initColor[i][0];
float f2 = BlockColor.initColor[i][1];
float f3 = BlockColor.initColor[i][2];
final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
if (data instanceof TileEntityBlockColorData) {
f = ((TileEntityBlockColorData)data).palette[i][0];
f2 = ((TileEntityBlockColorData)data).palette[i][1];
f3 = ((TileEntityBlockColorData)data).palette[i][2];
}
if (EntityRenderer.anaglyphEnable) {
final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
f = f4;
f2 = f5;
f3 = f6;
}
return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
示例11: renderBlockMeteor
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
float f = 1.0F;
int l = par1Block.colorMultiplier(var1, par2, par3, par4);
float f1 = (l >> 16 & 255) / 255.0F;
float f2 = (l >> 8 & 255) / 255.0F;
float f3 = (l & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable)
{
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f4;
f2 = f5;
f3 = f6;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
示例12: renderEntityName
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
* Renders an entity's name above its head (copied and modified from
* {@link RenderLivingBase})
*/
protected void renderEntityName(EntityLivingBase entity, String name, double x, double y, double z)
{
if (name.isEmpty())
{
return;
}
boolean sneaking = entity.isSneaking();
boolean thirdFrontal = this.manager.options.thirdPersonView == 2;
float px = this.manager.playerViewY;
float py = this.manager.playerViewX;
float pz = entity.height + 0.5F - (sneaking ? 0.25F : 0.0F);
int i = "deadmau5".equals(name) ? -10 : 0;
EntityRenderer.drawNameplate(this.manager.getFontRenderer(), name, (float) x, (float) y + pz, (float) z, i, px, py, thirdFrontal, sneaking);
}
示例13: playSplashSound
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
protected void playSplashSound(final EntityRenderer renderer, final World world, final Entity player, double x,
double y, double z) {
this.pos.setPos(x, y - 1, z);
final boolean hasDust = biomeHasDust(world.getBiome(this.pos));
final Block block = WorldUtils.getBlockState(world, this.pos).getBlock();
final SoundEvent sound = getBlockSoundFX(block, hasDust, world);
if (sound != null) {
final float volume = calculateRainSoundVolume(world);
float pitch = 1.0F;
final int playerY = MathHelper.floor(player.posY);
this.pos.setPos(player.posX, 0, player.posZ);
if (y > player.posY + 1.0D && getPrecipitationHeight(world, 0, this.pos).getY() > playerY)
pitch = 0.5F;
pitch -= (this.RANDOM.nextFloat() - this.RANDOM.nextFloat()) * 0.1F;
this.pos.setPos(x, y, z);
SoundEngine.instance().playSound(this.pos, sound, SoundCategory.WEATHER, volume, pitch);
}
}
示例14: onEnable
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
@Override
public void onEnable() {
if (OpenGlHelper.shadersSupported) {
if (Minecraft.getMinecraft().func_175606_aa() instanceof EntityPlayer) {
if (Minecraft.getMinecraft().entityRenderer.theShaderGroup != null) {
Minecraft.getMinecraft().entityRenderer.theShaderGroup.deleteShaderGroup();
}
Minecraft.getMinecraft().entityRenderer.shaderIndex = 19;
if (Minecraft.getMinecraft().entityRenderer.shaderIndex != EntityRenderer.shaderCount) {
Minecraft.getMinecraft().entityRenderer.func_175069_a(EntityRenderer.shaderResourceLocations[19]);
} else {
Minecraft.getMinecraft().entityRenderer.theShaderGroup = null;
}
}
}
WurstClient.INSTANCE.events.add(UpdateListener.class, this);
}
示例15: activateBatch
import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public void activateBatch()
{
if(batch != null)
{
if(OpenGlHelper.shadersSupported)
{
try
{
ShaderGroup theShaderGroup = batch.toShaderGroup(resManager);
theShaderGroup.createBindFramebuffers(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, theShaderGroup, 51);
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, true, 55);
}
catch(JsonException e)
{
e.printStackTrace();
}
}
}
}