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


Java Block.getStateById方法代码示例

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


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

示例1: getConstantPatternResult

import net.minecraft.block.Block; //导入方法依赖的package包/类
private IBlockState getConstantPatternResult(String text) {
    if (text.codePoints().allMatch(c -> '0' <= c && c <= '9')) {
        // blockstate number
        IBlockState stateConstant = Block.getStateById(Integer.parseInt(text));
        // don't accidentally include air!
        if (stateConstant.getBlock() != Blocks.AIR || text.equals("0")) {
            return stateConstant;
        } else {
            // no use doing the other branch here
            return null;
        }
    }
    if (text.codePoints().allMatch(BLOCK_ID_CPS)) {
        // string block ID?
        Block block = Block.getBlockFromName(text);
        if (block != null) {
            return block.getDefaultState();
        }
    }
    return null;
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:22,代码来源:BlockPatternArg.java

示例2: createParticle

import net.minecraft.block.Block; //导入方法依赖的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: createParticle

import net.minecraft.block.Block; //导入方法依赖的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: getDisplayTile

import net.minecraft.block.Block; //导入方法依赖的package包/类
public IBlockState getDisplayTile()
{
    return !this.hasDisplayTile() ? this.getDefaultDisplayTile() : Block.getStateById(this.getDataWatcher().getWatchableObjectInt(20));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityMinecart.java

示例5: getHeldBlockState

import net.minecraft.block.Block; //导入方法依赖的package包/类
/**
 * Gets this enderman's held block state
 */
public IBlockState getHeldBlockState()
{
    return Block.getStateById(this.dataWatcher.getWatchableObjectShort(16) & 65535);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:EntityEnderman.java

示例6: getEntityFX

import net.minecraft.block.Block; //导入方法依赖的package包/类
public EntityFX getEntityFX(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.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).func_174845_l();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:EntityBlockDustFX.java

示例7: getState

import net.minecraft.block.Block; //导入方法依赖的package包/类
@Deprecated
public static IBlockState getState(int idmeta) {
    return Block.getStateById(idmeta);
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:ZWrapper.java

示例8: getDisplayTile

import net.minecraft.block.Block; //导入方法依赖的package包/类
public IBlockState getDisplayTile()
{
    return !this.hasDisplayTile() ? this.getDefaultDisplayTile() : Block.getStateById(((Integer)this.getDataManager().get(DISPLAY_TILE)).intValue());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:EntityMinecart.java

示例9: createParticle

import net.minecraft.block.Block; //导入方法依赖的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: createParticle

import net.minecraft.block.Block; //导入方法依赖的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.Block.getStateById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。