net.minecraft.block.Block.isSideSolid()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中net.minecraft.block.Block.isSideSolid()方法的一些代码示例,展示了Block.isSideSolid()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.isSideSolid()方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:isSideSolid

Block.isSideSolid介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

public boolean isSideValid( final EnumFacing side )
{
  final BlockPos p = this.pos.offset( side );
  final IBlockState blk = this.world.getBlockState( p );
  return blk.getBlock().isSideSolid( this.world.getBlockState( p ), this.world, p, side.getOpposite() );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

public void addBlot( final ItemStack type, final EnumFacing side, final Vec3d hitVec )
{
  final BlockPos p = this.pos.offset( side );
  final IBlockState blk = this.world.getBlockState( p );
  if( blk.getBlock().isSideSolid( this.world.getBlockState( p ), this.world, p, side.getOpposite() ) )
  {
    final ItemPaintBall ipb = (ItemPaintBall) type.getItem();
    final AEColor col = ipb.getColor( type );
    final boolean lit = ipb.isLumen( type );
    if( this.dots == null )
    {
      this.dots = new ArrayList<>();
    }
    if( this.dots.size() > 20 )
    {
      this.dots.remove( 0 );
    }
    this.dots.add( new Splotch( col, lit, side, hitVec ) );
    if( lit )
    {
      this.isLit += LIGHT_PER_DOT;
    }
    this.maxLit();
    this.markForUpdate();
    this.saveChanges();
  }
}

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) {
  return block.isSideSolid(this, world, pos, side);
}

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) {
  return normalState.getBlock().isSideSolid(this, world, pos, side);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public boolean isSideSolid(@Nonnull BlockPos pos, @Nonnull EnumFacing side, boolean _default) {
 IBlockState paintSource = getPaintSource(pos);
 if (paintSource != null) {
  return paintSource.getBlock().isSideSolid(paintSource, this, pos, side);
 }
 return super.isSideSolid(pos, side, _default);
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
  Block block = mcmpBlockAccess.getBlock();
  return block != null ? block.isSideSolid(state, world, pos, side) : super.isSideSolid(state, world, pos, side);
}

代码示例来源:origin: SleepyTrousers/EnderIO

public FillGaugeBakery(IBlockAccess world, BlockPos pos, @Nonnull EnumFacing face, @Nonnull TextureAtlasSprite tex) {
 this.world = world;
 this.pos = pos;
 this.face = face;
 this.tex = tex;
 IBlockState bs = world.getBlockState(pos.offset(face));
 if (bs.getBlock().isSideSolid(bs, world, pos.offset(face), face.getOpposite())) {
  return;
 }
 IBlockState state = world.getBlockState(pos);
 if (!(state.getBlock() instanceof BlockCapBank)) {
  return;
 }
 bankType = state.getValue(CapBankType.KIND);
 if (!bankType.isMultiblock()) {
  // no connection possible
  height = 1;
  myOffset = 0;
  connectUp = connectDown = false;
 } else {
  // determine connections
  countNeighbors();
 }
 if (bankType.isCreative()) {
  localFillLevel = 8; // px
 } else {
  calculateFillLevel();
 }
 mkQuads();
}

代码示例来源:origin: RS485/LogisticsPipes

DoubleCoordinates pos = CoordinateUtils.add(new DoubleCoordinates((TileEntity) pipeTile), dir);
Block blockSide = pos.getBlock(pipeTile.getWorld());
if (blockSide == null || !blockSide.isSideSolid(pos.getBlockState(pipeTile.getWorld()), pipeTile.getWorld(), pos.getBlockPos(), dir.getOpposite()) || renderState.pipeConnectionMatrix.isConnected(dir)) {
  mountCanidates.removeIf(mount -> mount.dir == dir);
} else {

代码示例来源:origin: sinkillerj/ProjectE

else if (b.isSideSolid(world.getBlockState(pos), world, pos, EnumFacing.UP))

代码示例来源:origin: TeamLapen/Vampirism

private boolean placeTent(World worldIn, Random rand, BlockPos position, EnumFacing facing) {
  if (ground.getBlock().isSideSolid(ground, worldIn, position.down(), EnumFacing.UP)) {

代码示例来源:origin: Vazkii/Quark

@SubscribeEvent
public void onInteract(PlayerInteractEvent.RightClickBlock event) {
  EntityPlayer player = event.getEntityPlayer();
  if(player.getRidingEntity() != null)
    return;
  
  World world = event.getWorld();
  BlockPos pos = event.getPos();
  
  Vec3d vec = new Vec3d(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
  double maxDist = 2;
  if((vec.x - player.posX) * (vec.x - player.posX) + (vec.y - player.posY) * (vec.y - player.posY) + (vec.z - player.posZ) * (vec.z - player.posZ) > maxDist * maxDist)
    return;
  
  IBlockState state = world.getBlockState(pos);
  ItemStack stack1 = player.getHeldItemMainhand();
  ItemStack stack2 = player.getHeldItemOffhand();
  if(!stack1.isEmpty() || !stack2.isEmpty())
    return;
  if(state.getBlock() instanceof BlockStairs && state.getValue(BlockStairs.HALF) == EnumHalf.BOTTOM && !state.getBlock().isSideSolid(state, world, pos, event.getFace()) && canBeAbove(world, pos)) {
    List<Seat> seats = world.getEntitiesWithinAABB(Seat.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)));
    if(seats.isEmpty()) {
      Seat seat = new Seat(world, pos);
      world.spawnEntity(seat);
      event.getEntityPlayer().startRiding(seat);
    }
  }
}

代码示例来源:origin: NanamiArihara/FoodCraft-Reloaded

@Override
  public boolean matches(World world, BlockPos pos) {
    IBlockState state = world.getBlockState(pos);
    Block block = state.getBlock();
    switch (this.plantType) {
      case Desert:
        return block == Blocks.SAND || block == Blocks.HARDENED_CLAY || block == Blocks.STAINED_HARDENED_CLAY || block == Blocks.DIRT;
      case Nether:
        return block == Blocks.SOUL_SAND;
      case Crop:
        return block == Blocks.FARMLAND;
      case Cave:
        return block.isSideSolid(state, world, pos, EnumFacing.UP);
      case Plains:
        return block == Blocks.GRASS || block == Blocks.DIRT || block == Blocks.FARMLAND || block == Blocks.MYCELIUM;
      case Water:
        return state.getMaterial() == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0;
      case Beach:
        boolean isBeach = block == Blocks.GRASS || block == Blocks.DIRT || block == Blocks.SAND || block == Blocks.MYCELIUM;
        boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
          world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
          world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
          world.getBlockState(pos.south()).getMaterial() == Material.WATER);
        return isBeach && hasWater;
      default:
        return false;
    }
  }
}

代码示例来源:origin: Esteemed-Innovation/Esteemed-Innovation

IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if (face != EnumFacing.UP && block.isSideSolid(state, world, pos, face)) {
  AxisAlignedBB aabb;
  if (face == EnumFacing.DOWN) {

相关文章

Block类方法