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


Java IBlockAccess.getBlockState方法代码示例

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


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

示例1: func_176364_g

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public boolean func_176364_g(IBlockAccess blockAccess, BlockPos pos)
{
    for (int i = -1; i <= 1; ++i)
    {
        for (int j = -1; j <= 1; ++j)
        {
            IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j));
            Block block = iblockstate.getBlock();
            Material material = block.getMaterial();

            if (material != this.blockMaterial && !block.isFullBlock())
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:BlockLiquid.java

示例2: isConnectedTo

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing direction)
{
    BlockPos blockpos = pos.offset(direction);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    Block block = iblockstate.getBlock();

    if (block == Blocks.TRIPWIRE_HOOK)
    {
        EnumFacing enumfacing = direction.getOpposite();
        return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing;
    }
    else
    {
        return block == Blocks.TRIPWIRE;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:BlockTripWire.java

示例3: isConnectedTo

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing direction)
{
    BlockPos blockpos = pos.offset(direction);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    Block block = iblockstate.getBlock();

    if (block == Blocks.tripwire_hook)
    {
        EnumFacing enumfacing = direction.getOpposite();
        return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing;
    }
    else if (block == Blocks.tripwire)
    {
        boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue();
        boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue();
        return flag == flag1;
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:BlockTripWire.java

示例4: shouldSideBeRendered

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    switch (side)
    {
        case UP:
            return true;
        case NORTH:
        case SOUTH:
        case WEST:
        case EAST:
            IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
            Block block = iblockstate.getBlock();
            return !iblockstate.isOpaqueCube() && block != Blocks.FARMLAND && block != Blocks.GRASS_PATH;
        default:
            return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:BlockGrassPath.java

示例5: shouldSideBeRendered

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (this == Blocks.glass || this == Blocks.stained_glass)
    {
        if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
        {
            return true;
        }

        if (block == this)
        {
            return false;
        }
    }

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:BlockBreakable.java

示例6: func_176339_d

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
private boolean func_176339_d(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    BlockPos blockpos = pos.offset(side);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    Block block = iblockstate.getBlock();
    boolean flag = block.isNormalCube();
    boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube();
    return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down())));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:BlockRedstoneWire.java

示例7: shouldSideBeRendered

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    EnumFacing.Axis enumfacing$axis = null;
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (worldIn.getBlockState(pos).getBlock() == this)
    {
        enumfacing$axis = (EnumFacing.Axis)iblockstate.getValue(AXIS);

        if (enumfacing$axis == null)
        {
            return false;
        }

        if (enumfacing$axis == EnumFacing.Axis.Z && side != EnumFacing.EAST && side != EnumFacing.WEST)
        {
            return false;
        }

        if (enumfacing$axis == EnumFacing.Axis.X && side != EnumFacing.SOUTH && side != EnumFacing.NORTH)
        {
            return false;
        }
    }

    boolean flag = worldIn.getBlockState(pos.west()).getBlock() == this && worldIn.getBlockState(pos.west(2)).getBlock() != this;
    boolean flag1 = worldIn.getBlockState(pos.east()).getBlock() == this && worldIn.getBlockState(pos.east(2)).getBlock() != this;
    boolean flag2 = worldIn.getBlockState(pos.north()).getBlock() == this && worldIn.getBlockState(pos.north(2)).getBlock() != this;
    boolean flag3 = worldIn.getBlockState(pos.south()).getBlock() == this && worldIn.getBlockState(pos.south(2)).getBlock() != this;
    boolean flag4 = flag || flag1 || enumfacing$axis == EnumFacing.Axis.X;
    boolean flag5 = flag2 || flag3 || enumfacing$axis == EnumFacing.Axis.Z;
    return flag4 && side == EnumFacing.WEST ? true : (flag4 && side == EnumFacing.EAST ? true : (flag5 && side == EnumFacing.NORTH ? true : flag5 && side == EnumFacing.SOUTH));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:BlockPortal.java

示例8: isLadder

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity)
{
    if (state.getValue(OPEN))
    {
        IBlockState down = world.getBlockState(pos.down());
        if (down.getBlock() == net.minecraft.init.Blocks.LADDER)
            return down.getValue(BlockLadder.FACING) == state.getValue(FACING);
    }
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:BlockTrapDoor.java

示例9: getPowerOnSide

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return this.isAlternateInput(iblockstate) ? (block == Blocks.REDSTONE_BLOCK ? 15 : (block == Blocks.REDSTONE_WIRE ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side))) : 0;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:BlockRedstoneDiode.java

示例10: canConnectTo

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return block == Blocks.BARRIER ? false : ((!(block instanceof BlockFence) || block.blockMaterial != this.blockMaterial) && !(block instanceof BlockFenceGate) ? (block.blockMaterial.isOpaque() && iblockstate.isFullCube() ? block.blockMaterial != Material.GOURD : false) : true);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BlockFence.java

示例11: canConnectTo

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
private boolean canConnectTo(IBlockAccess worldIn, BlockPos pos)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return block == Blocks.BARRIER ? false : (block != this && !(block instanceof BlockFenceGate) ? (block.blockMaterial.isOpaque() && iblockstate.isFullCube() ? block.blockMaterial != Material.GOURD : false) : true);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:BlockWall.java

示例12: getFluidHeight

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
private float getFluidHeight(IBlockAccess blockAccess, BlockPos blockPosIn, Material blockMaterial)
{
    int i = 0;
    float f = 0.0F;

    for (int j = 0; j < 4; ++j)
    {
        BlockPos blockpos = blockPosIn.add(-(j & 1), 0, -(j >> 1 & 1));

        if (blockAccess.getBlockState(blockpos.up()).getBlock().getMaterial() == blockMaterial)
        {
            return 1.0F;
        }

        IBlockState iblockstate = blockAccess.getBlockState(blockpos);
        Material material = iblockstate.getBlock().getMaterial();

        if (material != blockMaterial)
        {
            if (!material.isSolid())
            {
                ++f;
                ++i;
            }
        }
        else
        {
            int k = ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue();

            if (k >= 8 || k == 0)
            {
                f += BlockLiquid.getLiquidHeightPercent(k) * 10.0F;
                i += 10;
            }

            f += BlockLiquid.getLiquidHeightPercent(k);
            ++i;
        }
    }

    return 1.0F - f / (float)i;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:BlockFluidRenderer.java

示例13: getPowerOnSide

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return this.canPowerSide(block) ? (block == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side)) : 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:BlockRedstoneDiode.java

示例14: shouldSideBeRendered

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
    Block block = iblockstate.getBlock();
    return !iblockstate.isOpaqueCube() && block != Blocks.END_GATEWAY;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:BlockEndGateway.java

示例15: isBurning

import net.minecraft.world.IBlockAccess; //导入方法依赖的package包/类
@Override
public boolean isBurning(IBlockAccess world, BlockPos pos)
{
    IBlockState state = world.getBlockState(pos);
    return getContent().isBurning.get(getSubtype(state)).orElse(false);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:7,代码来源:BlockMixin.java


注:本文中的net.minecraft.world.IBlockAccess.getBlockState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。