當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。