本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
示例4: getDisplayTile
import net.minecraft.block.Block; //导入方法依赖的package包/类
public IBlockState getDisplayTile()
{
return !this.hasDisplayTile() ? this.getDefaultDisplayTile() : Block.getStateById(this.getDataWatcher().getWatchableObjectInt(20));
}
示例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);
}
示例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();
}
示例7: getState
import net.minecraft.block.Block; //导入方法依赖的package包/类
@Deprecated
public static IBlockState getState(int idmeta) {
return Block.getStateById(idmeta);
}
示例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());
}
示例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();
}
示例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();
}