Java 类net.minecraft.block.state.BlockStateBase 实例源码

项目:BaseClient    文件:Matches.java   
public static boolean block(BlockStateBase p_block_0_, MatchBlock[] p_block_1_)
{
    if (p_block_1_ == null)
    {
        return true;
    }
    else
    {
        for (int i = 0; i < p_block_1_.length; ++i)
        {
            MatchBlock matchblock = p_block_1_[i];

            if (matchblock.matches(p_block_0_))
            {
                return true;
            }
        }

        return false;
    }
}
项目:BaseClient    文件:RenderEnv.java   
public int getBlockId()
{
    if (this.blockId < 0)
    {
        if (this.blockState instanceof BlockStateBase)
        {
            BlockStateBase blockstatebase = (BlockStateBase)this.blockState;
            this.blockId = blockstatebase.getBlockId();
        }
        else
        {
            this.blockId = Block.getIdFromBlock(this.blockState.getBlock());
        }
    }

    return this.blockId;
}
项目:BaseClient    文件:RenderEnv.java   
public int getMetadata()
{
    if (this.metadata < 0)
    {
        if (this.blockState instanceof BlockStateBase)
        {
            BlockStateBase blockstatebase = (BlockStateBase)this.blockState;
            this.metadata = blockstatebase.getMetadata();
        }
        else
        {
            this.metadata = this.blockState.getBlock().getMetaFromState(this.blockState);
        }
    }

    return this.metadata;
}
项目:Backmemed    文件:SVertexBuilder.java   
public static void pushEntity(IBlockState blockState, BlockPos blockPos, IBlockAccess blockAccess, VertexBuffer wrr)
{
    Block block = blockState.getBlock();
    int i;
    int j;

    if (blockState instanceof BlockStateBase)
    {
        BlockStateBase blockstatebase = (BlockStateBase)blockState;
        i = blockstatebase.getBlockId();
        j = blockstatebase.getMetadata();
    }
    else
    {
        i = Block.getIdFromBlock(block);
        j = block.getMetaFromState(blockState);
    }

    i = BlockAliases.getMappedBlockId(i, j);
    int i1 = block.getRenderType(blockState).ordinal();
    int k = ((i1 & 65535) << 16) + (i & 65535);
    int l = j & 65535;
    wrr.sVertexBuilder.pushEntity(((long)l << 32) + (long)k);
}
项目:Backmemed    文件:Matches.java   
public static boolean block(BlockStateBase p_block_0_, MatchBlock[] p_block_1_)
{
    if (p_block_1_ == null)
    {
        return true;
    }
    else
    {
        for (int i = 0; i < p_block_1_.length; ++i)
        {
            MatchBlock matchblock = p_block_1_[i];

            if (matchblock.matches(p_block_0_))
            {
                return true;
            }
        }

        return false;
    }
}
项目:Backmemed    文件:RenderEnv.java   
public int getBlockId()
{
    if (this.blockId < 0)
    {
        if (this.blockState instanceof BlockStateBase)
        {
            BlockStateBase blockstatebase = (BlockStateBase)this.blockState;
            this.blockId = blockstatebase.getBlockId();
        }
        else
        {
            this.blockId = Block.getIdFromBlock(this.blockState.getBlock());
        }
    }

    return this.blockId;
}
项目:Backmemed    文件:RenderEnv.java   
public int getMetadata()
{
    if (this.metadata < 0)
    {
        if (this.blockState instanceof BlockStateBase)
        {
            BlockStateBase blockstatebase = (BlockStateBase)this.blockState;
            this.metadata = blockstatebase.getMetadata();
        }
        else
        {
            this.metadata = this.blockState.getBlock().getMetaFromState(this.blockState);
        }
    }

    return this.metadata;
}
项目:BaseClient    文件:MatchBlock.java   
public boolean matches(BlockStateBase p_matches_1_)
{
    if (p_matches_1_.getBlockId() != this.blockId)
    {
        return false;
    }
    else
    {
        if (this.metadatas != null)
        {
            boolean flag = false;
            int i = p_matches_1_.getMetadata();

            for (int j = 0; j < this.metadatas.length; ++j)
            {
                int k = this.metadatas[j];

                if (k == i)
                {
                    flag = true;
                    break;
                }
            }

            if (!flag)
            {
                return false;
            }
        }

        return true;
    }
}
项目:Backmemed    文件:ConnectedTextures.java   
private static boolean isNeighbourOverlay(ConnectedProperties p_isNeighbourOverlay_0_, IBlockAccess p_isNeighbourOverlay_1_, IBlockState p_isNeighbourOverlay_2_, BlockPos p_isNeighbourOverlay_3_, int p_isNeighbourOverlay_4_, TextureAtlasSprite p_isNeighbourOverlay_5_, int p_isNeighbourOverlay_6_)
{
    IBlockState iblockstate = p_isNeighbourOverlay_1_.getBlockState(p_isNeighbourOverlay_3_);

    if (!isFullCubeModel(iblockstate))
    {
        return false;
    }
    else
    {
        if (p_isNeighbourOverlay_0_.connectBlocks != null)
        {
            BlockStateBase blockstatebase = (BlockStateBase)iblockstate;

            if (!Matches.block(blockstatebase.getBlockId(), blockstatebase.getMetadata(), p_isNeighbourOverlay_0_.connectBlocks))
            {
                return false;
            }
        }

        if (p_isNeighbourOverlay_0_.connectTileIcons != null)
        {
            TextureAtlasSprite textureatlassprite = getNeighbourIcon(p_isNeighbourOverlay_1_, p_isNeighbourOverlay_2_, p_isNeighbourOverlay_3_, iblockstate, p_isNeighbourOverlay_4_);

            if (!Config.isSameOne(textureatlassprite, p_isNeighbourOverlay_0_.connectTileIcons))
            {
                return false;
            }
        }

        IBlockState iblockstate1 = p_isNeighbourOverlay_1_.getBlockState(p_isNeighbourOverlay_3_.offset(getFacing(p_isNeighbourOverlay_4_)));
        return iblockstate1.isOpaqueCube() ? false : (p_isNeighbourOverlay_4_ == 1 && iblockstate1.getBlock() == Blocks.SNOW_LAYER ? false : !isNeighbour(p_isNeighbourOverlay_0_, p_isNeighbourOverlay_1_, p_isNeighbourOverlay_2_, p_isNeighbourOverlay_3_, iblockstate, p_isNeighbourOverlay_4_, p_isNeighbourOverlay_5_, p_isNeighbourOverlay_6_));
    }
}
项目:Backmemed    文件:ConnectedTextures.java   
private static boolean isNeighbourMatching(ConnectedProperties p_isNeighbourMatching_0_, IBlockAccess p_isNeighbourMatching_1_, IBlockState p_isNeighbourMatching_2_, BlockPos p_isNeighbourMatching_3_, int p_isNeighbourMatching_4_, TextureAtlasSprite p_isNeighbourMatching_5_, int p_isNeighbourMatching_6_)
{
    IBlockState iblockstate = p_isNeighbourMatching_1_.getBlockState(p_isNeighbourMatching_3_);

    if (iblockstate == AIR_DEFAULT_STATE)
    {
        return false;
    }
    else
    {
        if (p_isNeighbourMatching_0_.matchBlocks != null && iblockstate instanceof BlockStateBase)
        {
            BlockStateBase blockstatebase = (BlockStateBase)iblockstate;

            if (!p_isNeighbourMatching_0_.matchesBlock(blockstatebase.getBlockId(), blockstatebase.getMetadata()))
            {
                return false;
            }
        }

        if (p_isNeighbourMatching_0_.matchTileIcons != null)
        {
            TextureAtlasSprite textureatlassprite = getNeighbourIcon(p_isNeighbourMatching_1_, p_isNeighbourMatching_2_, p_isNeighbourMatching_3_, iblockstate, p_isNeighbourMatching_4_);

            if (textureatlassprite != p_isNeighbourMatching_5_)
            {
                return false;
            }
        }

        IBlockState iblockstate1 = p_isNeighbourMatching_1_.getBlockState(p_isNeighbourMatching_3_.offset(getFacing(p_isNeighbourMatching_4_)));
        return iblockstate1.isOpaqueCube() ? false : p_isNeighbourMatching_4_ != 1 || iblockstate1.getBlock() != Blocks.SNOW_LAYER;
    }
}
项目:Backmemed    文件:ConnectedTextures.java   
private static boolean isNeighbour(ConnectedProperties p_isNeighbour_0_, IBlockAccess p_isNeighbour_1_, IBlockState p_isNeighbour_2_, BlockPos p_isNeighbour_3_, IBlockState p_isNeighbour_4_, int p_isNeighbour_5_, TextureAtlasSprite p_isNeighbour_6_, int p_isNeighbour_7_)
{
    if (p_isNeighbour_2_ == p_isNeighbour_4_)
    {
        return true;
    }
    else if (p_isNeighbour_0_.connect == 2)
    {
        if (p_isNeighbour_4_ == null)
        {
            return false;
        }
        else if (p_isNeighbour_4_ == AIR_DEFAULT_STATE)
        {
            return false;
        }
        else
        {
            TextureAtlasSprite textureatlassprite = getNeighbourIcon(p_isNeighbour_1_, p_isNeighbour_2_, p_isNeighbour_3_, p_isNeighbour_4_, p_isNeighbour_5_);
            return textureatlassprite == p_isNeighbour_6_;
        }
    }
    else if (p_isNeighbour_0_.connect == 3)
    {
        return p_isNeighbour_4_ == null ? false : (p_isNeighbour_4_ == AIR_DEFAULT_STATE ? false : p_isNeighbour_4_.getMaterial() == p_isNeighbour_2_.getMaterial());
    }
    else if (!(p_isNeighbour_4_ instanceof BlockStateBase))
    {
        return false;
    }
    else
    {
        BlockStateBase blockstatebase = (BlockStateBase)p_isNeighbour_4_;
        Block block = blockstatebase.getBlock();
        int i = blockstatebase.getMetadata();
        return block == p_isNeighbour_2_.getBlock() && i == p_isNeighbour_7_;
    }
}
项目:minecraft-roguelike    文件:MetaBlock.java   
public IBlockState getState(){

    if(this.state instanceof MetaBlock){
        return ((MetaBlock)this.state).getState();
    }

    return (BlockStateBase)this.state;
}
项目:BaseClient    文件:MatchBlock.java   
public boolean matches(BlockStateBase p_matches_1_)
{
    return p_matches_1_.getBlockId() != this.blockId ? false : Matches.metadata(p_matches_1_.getMetadata(), this.metadatas);
}
项目:BaseClient    文件:CustomColormap.java   
public boolean matchesBlock(BlockStateBase p_matchesBlock_1_)
{
    return Matches.block(p_matchesBlock_1_, this.matchBlocks);
}
项目:BaseClient    文件:CustomColors.java   
private static CustomColormap getBlockColormap(IBlockState p_getBlockColormap_0_)
{
    if (blockColormaps == null)
    {
        return null;
    }
    else if (!(p_getBlockColormap_0_ instanceof BlockStateBase))
    {
        return null;
    }
    else
    {
        BlockStateBase blockstatebase = (BlockStateBase)p_getBlockColormap_0_;
        int i = blockstatebase.getBlockId();

        if (i >= 0 && i < blockColormaps.length)
        {
            CustomColormap[] acustomcolormap = blockColormaps[i];

            if (acustomcolormap == null)
            {
                return null;
            }
            else
            {
                for (int j = 0; j < acustomcolormap.length; ++j)
                {
                    CustomColormap customcolormap = acustomcolormap[j];

                    if (customcolormap.matchesBlock(blockstatebase))
                    {
                        return customcolormap;
                    }
                }

                return null;
            }
        }
        else
        {
            return null;
        }
    }
}
项目:BaseClient    文件:ConnectedTextures.java   
public static TextureAtlasSprite getConnectedTextureSingle(IBlockAccess p_getConnectedTextureSingle_0_, IBlockState p_getConnectedTextureSingle_1_, BlockPos p_getConnectedTextureSingle_2_, EnumFacing p_getConnectedTextureSingle_3_, TextureAtlasSprite p_getConnectedTextureSingle_4_, boolean p_getConnectedTextureSingle_5_, RenderEnv p_getConnectedTextureSingle_6_)
{
    Block block = p_getConnectedTextureSingle_1_.getBlock();

    if (!(p_getConnectedTextureSingle_1_ instanceof BlockStateBase))
    {
        return p_getConnectedTextureSingle_4_;
    }
    else
    {
        BlockStateBase blockstatebase = (BlockStateBase)p_getConnectedTextureSingle_1_;

        if (tileProperties != null)
        {
            int i = p_getConnectedTextureSingle_4_.getIndexInMap();

            if (i >= 0 && i < tileProperties.length)
            {
                ConnectedProperties[] aconnectedproperties = tileProperties[i];

                if (aconnectedproperties != null)
                {
                    int j = getSide(p_getConnectedTextureSingle_3_);

                    for (int k = 0; k < aconnectedproperties.length; ++k)
                    {
                        ConnectedProperties connectedproperties = aconnectedproperties[k];

                        if (connectedproperties != null && connectedproperties.matchesBlockId(blockstatebase.getBlockId()))
                        {
                            TextureAtlasSprite textureatlassprite = getConnectedTexture(connectedproperties, p_getConnectedTextureSingle_0_, blockstatebase, p_getConnectedTextureSingle_2_, j, p_getConnectedTextureSingle_4_, p_getConnectedTextureSingle_6_);

                            if (textureatlassprite != null)
                            {
                                return textureatlassprite;
                            }
                        }
                    }
                }
            }
        }

        if (blockProperties != null && p_getConnectedTextureSingle_5_)
        {
            int l = p_getConnectedTextureSingle_6_.getBlockId();

            if (l >= 0 && l < blockProperties.length)
            {
                ConnectedProperties[] aconnectedproperties1 = blockProperties[l];

                if (aconnectedproperties1 != null)
                {
                    int i1 = getSide(p_getConnectedTextureSingle_3_);

                    for (int j1 = 0; j1 < aconnectedproperties1.length; ++j1)
                    {
                        ConnectedProperties connectedproperties1 = aconnectedproperties1[j1];

                        if (connectedproperties1 != null && connectedproperties1.matchesIcon(p_getConnectedTextureSingle_4_))
                        {
                            TextureAtlasSprite textureatlassprite1 = getConnectedTexture(connectedproperties1, p_getConnectedTextureSingle_0_, blockstatebase, p_getConnectedTextureSingle_2_, i1, p_getConnectedTextureSingle_4_, p_getConnectedTextureSingle_6_);

                            if (textureatlassprite1 != null)
                            {
                                return textureatlassprite1;
                            }
                        }
                    }
                }
            }
        }

        return p_getConnectedTextureSingle_4_;
    }
}
项目:Backmemed    文件:MatchBlock.java   
public boolean matches(BlockStateBase p_matches_1_)
{
    return p_matches_1_.getBlockId() != this.blockId ? false : Matches.metadata(p_matches_1_.getMetadata(), this.metadatas);
}
项目:Backmemed    文件:CustomColormap.java   
public boolean matchesBlock(BlockStateBase p_matchesBlock_1_)
{
    return Matches.block(p_matchesBlock_1_, this.matchBlocks);
}
项目:Backmemed    文件:CustomColors.java   
private static CustomColormap getBlockColormap(IBlockState p_getBlockColormap_0_)
{
    if (blockColormaps == null)
    {
        return null;
    }
    else if (!(p_getBlockColormap_0_ instanceof BlockStateBase))
    {
        return null;
    }
    else
    {
        BlockStateBase blockstatebase = (BlockStateBase)p_getBlockColormap_0_;
        int i = blockstatebase.getBlockId();

        if (i >= 0 && i < blockColormaps.length)
        {
            CustomColormap[] acustomcolormap = blockColormaps[i];

            if (acustomcolormap == null)
            {
                return null;
            }
            else
            {
                for (int j = 0; j < acustomcolormap.length; ++j)
                {
                    CustomColormap customcolormap = acustomcolormap[j];

                    if (customcolormap.matchesBlock(blockstatebase))
                    {
                        return customcolormap;
                    }
                }

                return null;
            }
        }
        else
        {
            return null;
        }
    }
}
项目:Backmemed    文件:ConnectedTextures.java   
public static BakedQuad[] getConnectedTextureSingle(IBlockAccess p_getConnectedTextureSingle_0_, IBlockState p_getConnectedTextureSingle_1_, BlockPos p_getConnectedTextureSingle_2_, EnumFacing p_getConnectedTextureSingle_3_, BakedQuad p_getConnectedTextureSingle_4_, boolean p_getConnectedTextureSingle_5_, int p_getConnectedTextureSingle_6_, RenderEnv p_getConnectedTextureSingle_7_)
{
    Block block = p_getConnectedTextureSingle_1_.getBlock();

    if (!(p_getConnectedTextureSingle_1_ instanceof BlockStateBase))
    {
        return p_getConnectedTextureSingle_7_.getArrayQuadsCtm(p_getConnectedTextureSingle_4_);
    }
    else
    {
        BlockStateBase blockstatebase = (BlockStateBase)p_getConnectedTextureSingle_1_;
        TextureAtlasSprite textureatlassprite = p_getConnectedTextureSingle_4_.getSprite();

        if (tileProperties != null)
        {
            int i = textureatlassprite.getIndexInMap();

            if (i >= 0 && i < tileProperties.length)
            {
                ConnectedProperties[] aconnectedproperties = tileProperties[i];

                if (aconnectedproperties != null)
                {
                    int j = getSide(p_getConnectedTextureSingle_3_);

                    for (int k = 0; k < aconnectedproperties.length; ++k)
                    {
                        ConnectedProperties connectedproperties = aconnectedproperties[k];

                        if (connectedproperties != null && connectedproperties.matchesBlockId(blockstatebase.getBlockId()))
                        {
                            BakedQuad[] abakedquad = getConnectedTexture(connectedproperties, p_getConnectedTextureSingle_0_, blockstatebase, p_getConnectedTextureSingle_2_, j, p_getConnectedTextureSingle_4_, p_getConnectedTextureSingle_6_, p_getConnectedTextureSingle_7_);

                            if (abakedquad != null)
                            {
                                return abakedquad;
                            }
                        }
                    }
                }
            }
        }

        if (blockProperties != null && p_getConnectedTextureSingle_5_)
        {
            int l = p_getConnectedTextureSingle_7_.getBlockId();

            if (l >= 0 && l < blockProperties.length)
            {
                ConnectedProperties[] aconnectedproperties1 = blockProperties[l];

                if (aconnectedproperties1 != null)
                {
                    int i1 = getSide(p_getConnectedTextureSingle_3_);

                    for (int j1 = 0; j1 < aconnectedproperties1.length; ++j1)
                    {
                        ConnectedProperties connectedproperties1 = aconnectedproperties1[j1];

                        if (connectedproperties1 != null && connectedproperties1.matchesIcon(textureatlassprite))
                        {
                            BakedQuad[] abakedquad1 = getConnectedTexture(connectedproperties1, p_getConnectedTextureSingle_0_, blockstatebase, p_getConnectedTextureSingle_2_, i1, p_getConnectedTextureSingle_4_, p_getConnectedTextureSingle_6_, p_getConnectedTextureSingle_7_);

                            if (abakedquad1 != null)
                            {
                                return abakedquad1;
                            }
                        }
                    }
                }
            }
        }

        return p_getConnectedTextureSingle_7_.getArrayQuadsCtm(p_getConnectedTextureSingle_4_);
    }
}