本文整理匯總了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();
}