當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumBlockRenderType.INVISIBLE屬性代碼示例

本文整理匯總了Java中net.minecraft.util.EnumBlockRenderType.INVISIBLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java EnumBlockRenderType.INVISIBLE屬性的具體用法?Java EnumBlockRenderType.INVISIBLE怎麽用?Java EnumBlockRenderType.INVISIBLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.util.EnumBlockRenderType的用法示例。


在下文中一共展示了EnumBlockRenderType.INVISIBLE屬性的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createParticle

@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,代碼行數:24,代碼來源:ParticleFallingDust.java

示例2: renderBlockBrightness

@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,代碼行數:19,代碼來源:BlockRendererDispatcher.java

示例3: createParticle

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,代碼行數:23,代碼來源:ParticleFallingDust.java

示例4: renderBlockBrightness

@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,代碼行數:21,代碼來源:BlockRendererDispatcher.java

示例5: createRunningParticles

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,代碼行數:13,代碼來源:Entity.java

示例6: getRenderType

@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
    return EnumBlockRenderType.INVISIBLE;
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:4,代碼來源:PortalBlock.java

示例7: addBlockHitEffects

/**
 * 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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:51,代碼來源:ParticleManager.java

示例8: getRenderType

/**
 * The type of render function called. MODEL for mixed tesr and static model, MODELBLOCK_ANIMATED for TESR-only,
 * LIQUID for vanilla liquids, INVISIBLE to skip all rendering
 */
public EnumBlockRenderType getRenderType(IBlockState state)
{
    return EnumBlockRenderType.INVISIBLE;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockBarrier.java

示例9: doRender

/**
 * 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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:47,代碼來源:RenderFallingBlock.java

示例10: createParticle

@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,代碼行數:6,代碼來源:ParticleBlockDust.java

示例11: renderShadow

/**
 * 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,代碼行數:57,代碼來源:Render.java

示例12: renderOverlays

/**
 * 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,代碼行數:54,代碼來源:ItemRenderer.java

示例13: renderBlock

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,代碼行數:48,代碼來源:BlockRendererDispatcher.java

示例14: createParticle

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,代碼行數:5,代碼來源:ParticleBlockDust.java


注:本文中的net.minecraft.util.EnumBlockRenderType.INVISIBLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。