本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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())));
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}