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


Java IBlockState.getRenderType方法代码示例

本文整理汇总了Java中net.minecraft.block.state.IBlockState.getRenderType方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.getRenderType方法的具体用法?Java IBlockState.getRenderType怎么用?Java IBlockState.getRenderType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.state.IBlockState的用法示例。


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

示例1: createParticle

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Nullable
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);

    if (iblockstate.getBlock() != Blocks.AIR && iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE)
    {
        return null;
    }
    else
    {
        int i = Minecraft.getMinecraft().getBlockColors().getColor(iblockstate);

        if (iblockstate.getBlock() instanceof BlockFalling)
        {
            i = ((BlockFalling)iblockstate.getBlock()).getDustColor(iblockstate);
        }

        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        return new ParticleFallingDust(worldIn, xCoordIn, yCoordIn, zCoordIn, f, f1, f2);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ParticleFallingDust.java

示例2: renderBlockBrightness

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void renderBlockBrightness(IBlockState state, float brightness)
{
    EnumBlockRenderType enumblockrendertype = state.getRenderType();

    if (enumblockrendertype != EnumBlockRenderType.INVISIBLE)
    {
        switch (enumblockrendertype)
        {
            case MODEL:
                IBakedModel ibakedmodel = this.getModelForState(state);
                this.blockModelRenderer.renderModelBrightness(ibakedmodel, state, brightness, true);
                break;

            case ENTITYBLOCK_ANIMATED:
                this.chestRenderer.renderChestBrightness(state.getBlock(), brightness);

            case LIQUID:
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:BlockRendererDispatcher.java

示例3: createParticle

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);

    if (iblockstate.getBlock() != Blocks.AIR && iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE)
    {
        return null;
    }
    else
    {
        int i = Minecraft.getMinecraft().getBlockColors().getColor(iblockstate);

        if (iblockstate.getBlock() instanceof BlockFalling)
        {
            i = ((BlockFalling)iblockstate.getBlock()).getDustColor(iblockstate);
        }

        float f = (float)(i >> 16 & 255) / 255.0F;
        float f1 = (float)(i >> 8 & 255) / 255.0F;
        float f2 = (float)(i & 255) / 255.0F;
        return new ParticleFallingDust(worldIn, xCoordIn, yCoordIn, zCoordIn, f, f1, f2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:ParticleFallingDust.java

示例4: renderBlockBrightness

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void renderBlockBrightness(IBlockState state, float brightness)
{
    EnumBlockRenderType enumblockrendertype = state.getRenderType();

    if (enumblockrendertype != EnumBlockRenderType.INVISIBLE)
    {
        switch (enumblockrendertype)
        {
            case MODEL:
                IBakedModel ibakedmodel = this.getModelForState(state);
                this.blockModelRenderer.renderModelBrightness(ibakedmodel, state, brightness, true);
                break;
            case ENTITYBLOCK_ANIMATED:
                this.chestRenderer.renderChestBrightness(state.getBlock(), brightness);
            case LIQUID:
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:BlockRendererDispatcher.java

示例5: createRunningParticles

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected void createRunningParticles()
{
    int i = MathHelper.floor(this.posX);
    int j = MathHelper.floor(this.posY - 0.20000000298023224D);
    int k = MathHelper.floor(this.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    IBlockState iblockstate = this.world.getBlockState(blockpos);

    if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
    {
        this.world.spawnParticle(EnumParticleTypes.BLOCK_CRACK, this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, new int[] {Block.getStateId(iblockstate)});
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:Entity.java

示例6: renderBlockDamage

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess)
{
    if (state.getRenderType() == EnumBlockRenderType.MODEL)
    {
        state = state.getActualState(blockAccess, pos);
        IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);
        IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(state, ibakedmodel, texture, pos)).makeBakedModel();
        this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getBuffer(), true);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:BlockRendererDispatcher.java

示例7: createRunningParticles

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected void createRunningParticles()
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.posY - 0.20000000298023224D);
    int k = MathHelper.floor_double(this.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    IBlockState iblockstate = this.worldObj.getBlockState(blockpos);

    if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, new int[] {Block.getStateId(iblockstate)});
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:Entity.java

示例8: renderBlockDamage

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess)
{
    if (state.getRenderType() == EnumBlockRenderType.MODEL)
    {
        state = state.getActualState(blockAccess, pos);
        IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state);
        IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, texture, state, blockAccess, pos);
        this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getBuffer(), true);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:BlockRendererDispatcher.java

示例9: createParticle

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Nullable
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);
    return iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE ? null : (new ParticleBlockDust(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).init();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:ParticleBlockDust.java

示例10: addBlockHitEffects

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Adds block hit particles for the specified block
 */
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = this.worldObj.getBlockState(pos);

    if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
    {
        int i = pos.getX();
        int j = pos.getY();
        int k = pos.getZ();
        float f = 0.1F;
        AxisAlignedBB axisalignedbb = iblockstate.getBoundingBox(this.worldObj, pos);
        double d0 = (double)i + this.rand.nextDouble() * (axisalignedbb.maxX - axisalignedbb.minX - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minX;
        double d1 = (double)j + this.rand.nextDouble() * (axisalignedbb.maxY - axisalignedbb.minY - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minY;
        double d2 = (double)k + this.rand.nextDouble() * (axisalignedbb.maxZ - axisalignedbb.minZ - 0.20000000298023224D) + 0.10000000149011612D + axisalignedbb.minZ;

        if (side == EnumFacing.DOWN)
        {
            d1 = (double)j + axisalignedbb.minY - 0.10000000149011612D;
        }

        if (side == EnumFacing.UP)
        {
            d1 = (double)j + axisalignedbb.maxY + 0.10000000149011612D;
        }

        if (side == EnumFacing.NORTH)
        {
            d2 = (double)k + axisalignedbb.minZ - 0.10000000149011612D;
        }

        if (side == EnumFacing.SOUTH)
        {
            d2 = (double)k + axisalignedbb.maxZ + 0.10000000149011612D;
        }

        if (side == EnumFacing.WEST)
        {
            d0 = (double)i + axisalignedbb.minX - 0.10000000149011612D;
        }

        if (side == EnumFacing.EAST)
        {
            d0 = (double)i + axisalignedbb.maxX + 0.10000000149011612D;
        }

        this.addEffect((new ParticleDigging(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).setBlockPos(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:ParticleManager.java

示例11: renderShadow

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Renders the entities shadow.
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
{
    if (!Config.isShaders() || !Shaders.shouldSkipDefaultShadow)
    {
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        this.renderManager.renderEngine.bindTexture(SHADOW_TEXTURES);
        World world = this.getWorldFromRenderManager();
        GlStateManager.depthMask(false);
        float f = this.shadowSize;

        if (entityIn instanceof EntityLiving)
        {
            EntityLiving entityliving = (EntityLiving)entityIn;
            f *= entityliving.getRenderSizeModifier();

            if (entityliving.isChild())
            {
                f *= 0.5F;
            }
        }

        double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
        double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
        double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
        int i = MathHelper.floor(d5 - (double)f);
        int j = MathHelper.floor(d5 + (double)f);
        int k = MathHelper.floor(d0 - (double)f);
        int l = MathHelper.floor(d0);
        int i1 = MathHelper.floor(d1 - (double)f);
        int j1 = MathHelper.floor(d1 + (double)f);
        double d2 = x - d5;
        double d3 = y - d0;
        double d4 = z - d1;
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

        for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1)))
        {
            IBlockState iblockstate = world.getBlockState(blockpos.down());

            if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE && world.getLightFromNeighbors(blockpos) > 3)
            {
                this.renderShadowSingle(iblockstate, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
            }
        }

        tessellator.draw();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableBlend();
        GlStateManager.depthMask(true);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:58,代码来源:Render.java

示例12: doRender

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityFallingBlock entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    if (entity.getBlock() != null)
    {
        IBlockState iblockstate = entity.getBlock();

        if (iblockstate.getRenderType() == EnumBlockRenderType.MODEL)
        {
            World world = entity.getWorldObj();

            if (iblockstate != world.getBlockState(new BlockPos(entity)) && iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
            {
                this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
                GlStateManager.pushMatrix();
                GlStateManager.disableLighting();
                Tessellator tessellator = Tessellator.getInstance();
                VertexBuffer vertexbuffer = tessellator.getBuffer();

                if (this.renderOutlines)
                {
                    GlStateManager.enableColorMaterial();
                    GlStateManager.enableOutlineMode(this.getTeamColor(entity));
                }

                vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
                BlockPos blockpos = new BlockPos(entity.posX, entity.getEntityBoundingBox().maxY, entity.posZ);
                GlStateManager.translate((float)(x - (double)blockpos.getX() - 0.5D), (float)(y - (double)blockpos.getY()), (float)(z - (double)blockpos.getZ() - 0.5D));
                BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
                blockrendererdispatcher.getBlockModelRenderer().renderModel(world, blockrendererdispatcher.getModelForState(iblockstate), iblockstate, blockpos, vertexbuffer, false, MathHelper.getPositionRandom(entity.getOrigin()));
                tessellator.draw();

                if (this.renderOutlines)
                {
                    GlStateManager.disableOutlineMode();
                    GlStateManager.disableColorMaterial();
                }

                GlStateManager.enableLighting();
                GlStateManager.popMatrix();
                super.doRender(entity, x, y, z, entityYaw, partialTicks);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:RenderFallingBlock.java

示例13: renderOverlays

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Renders the overlays.
 */
public void renderOverlays(float partialTicks)
{
    GlStateManager.disableAlpha();

    if (this.mc.player.isEntityInsideOpaqueBlock())
    {
        IBlockState iblockstate = this.mc.world.getBlockState(new BlockPos(this.mc.player));
        BlockPos blockpos = new BlockPos(this.mc.player);
        EntityPlayer entityplayer = this.mc.player;

        for (int i = 0; i < 8; ++i)
        {
            double d0 = entityplayer.posX + (double)(((float)((i >> 0) % 2) - 0.5F) * entityplayer.width * 0.8F);
            double d1 = entityplayer.posY + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F);
            double d2 = entityplayer.posZ + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayer.width * 0.8F);
            BlockPos blockpos1 = new BlockPos(d0, d1 + (double)entityplayer.getEyeHeight(), d2);
            IBlockState iblockstate1 = this.mc.world.getBlockState(blockpos1);

            if (iblockstate1.func_191058_s())
            {
                iblockstate = iblockstate1;
                blockpos = blockpos1;
            }
        }

        if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE)
        {
            Object object = Reflector.getFieldValue(Reflector.RenderBlockOverlayEvent_OverlayType_BLOCK);

            if (!Reflector.callBoolean(Reflector.ForgeEventFactory_renderBlockOverlay, new Object[] {this.mc.player, Float.valueOf(partialTicks), object, iblockstate, blockpos}))
            {
                this.renderBlockInHand(partialTicks, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate));
            }
        }
    }

    if (!this.mc.player.isSpectator())
    {
        if (this.mc.player.isInsideOfMaterial(Material.WATER) && !Reflector.callBoolean(Reflector.ForgeEventFactory_renderWaterOverlay, new Object[] {this.mc.player, Float.valueOf(partialTicks)}))
        {
            this.renderWaterOverlayTexture(partialTicks);
        }

        if (this.mc.player.isBurning() && !Reflector.callBoolean(Reflector.ForgeEventFactory_renderFireOverlay, new Object[] {this.mc.player, Float.valueOf(partialTicks)}))
        {
            this.renderFireInFirstPerson(partialTicks);
        }
    }

    GlStateManager.enableAlpha();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:55,代码来源:ItemRenderer.java

示例14: renderBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, VertexBuffer worldRendererIn)
{
    try
    {
        EnumBlockRenderType enumblockrendertype = state.getRenderType();

        if (enumblockrendertype == EnumBlockRenderType.INVISIBLE)
        {
            return false;
        }
        else
        {
            if (blockAccess.getWorldType() != WorldType.DEBUG_WORLD)
            {
                try
                {
                    state = state.getActualState(blockAccess, pos);
                }
                catch (Exception var8)
                {
                    ;
                }
            }

            switch (enumblockrendertype)
            {
                case MODEL:
                    return this.blockModelRenderer.renderModel(blockAccess, this.getModelForState(state), state, pos, worldRendererIn, true);

                case ENTITYBLOCK_ANIMATED:
                    return false;

                case LIQUID:
                    return this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn);

                default:
                    return false;
            }
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:49,代码来源:BlockRendererDispatcher.java

示例15: createParticle

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    IBlockState iblockstate = Block.getStateById(p_178902_15_[0]);
    return iblockstate.getRenderType() == EnumBlockRenderType.INVISIBLE ? null : (new ParticleBlockDust(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).init();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:ParticleBlockDust.java


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