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


Java EnumBlockRenderType類代碼示例

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


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

示例1: createParticle

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例2: createParticle

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例3: renderBlockBrightness

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例4: renderBlockBrightness

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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: BlockContainerBase

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
public BlockContainerBase(String unlocalizedName, String modId, Class<? extends TileEntity> tileEntityClass, EnumBlockRenderType renderType, boolean opaque, Material materialIn, MapColor color) {
    super(materialIn, color);
    setUnlocalizedName(unlocalizedName);
    setRegistryName(new ResourceLocation(modId, unlocalizedName));
    this.tileEntityClass = tileEntityClass;
    this.renderType = renderType;
    this.opaque = opaque;
}
 
開發者ID:sedlak477,項目名稱:MrglgaghCore,代碼行數:9,代碼來源:BlockContainerBase.java

示例6: createRunningParticles

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例7: renderBlockDamage

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例8: getRenderType

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
@Deprecated

    /**
     * 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.MODEL;
    }
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:11,代碼來源:Block.java

示例9: isEntityBlockAnimated

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
public boolean isEntityBlockAnimated(Block blockIn)
{
    if (blockIn == null)
    {
        return false;
    }
    else
    {
        EnumBlockRenderType enumblockrendertype = blockIn.getDefaultState().getRenderType();
        return enumblockrendertype == EnumBlockRenderType.MODEL ? false : enumblockrendertype == EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:13,代碼來源:BlockRendererDispatcher.java

示例10: renderBlockDamage

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例11: createRunningParticles

import net.minecraft.util.EnumBlockRenderType; //導入依賴的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

示例12: getRenderType

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
/**
 * 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.LIQUID;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:BlockLiquid.java

示例13: getRenderType

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
	return EnumBlockRenderType.MODEL;
}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:5,代碼來源:BlockPictureFrame.java

示例14: getRenderType

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
    return EnumBlockRenderType.MODEL;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:5,代碼來源:BlockPneumaticCraft.java

示例15: isRenderIDCamo

import net.minecraft.util.EnumBlockRenderType; //導入依賴的package包/類
public static boolean isRenderIDCamo(EnumBlockRenderType type) {
    return false;//TODO 1.8 remove PneumaticCraftAPIHandler.getInstance().concealableRenderIds.contains(renderID);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:4,代碼來源:PneumaticCraftUtils.java


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