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

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

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

Block.neighborChanged介绍

暂无

代码示例

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

@Override
  public void visit( final BlockPos pos )
  {
    final IBlockState state = this.dst.getBlockState( pos );
    final Block blk = state.getBlock();
    blk.neighborChanged( state, this.dst, pos, blk, pos );
  }
}

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

@Override
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
  super.setOrientation( inForward, inUp );
  final IBlockState state = this.world.getBlockState( this.pos );
  this.getBlockType().neighborChanged( state, this.world, this.pos, state.getBlock(), this.pos );
}

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

@Override
public void setOrientation( final EnumFacing inForward, final EnumFacing inUp )
{
  super.setOrientation( inForward, inUp );
  final IBlockState state = this.world.getBlockState( this.pos );
  this.getBlockType().neighborChanged( state, this.world, this.pos, state.getBlock(), this.pos );
}

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

@Override
public void neighborChanged(World world, BlockPos pos, Block block, BlockPos fromPos) {
  this.block.neighborChanged(this, world, pos, block, fromPos);
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
  super.neighborChanged(state, world, pos, block, fromPos);
  this.checkForDrop(world, pos, state);
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
  super.neighborChanged(state, world, pos, block, fromPos);
  this.checkForDrop(world, pos, state);
}

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

@Override
public void neighborChanged(World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
  normalState.getBlock().neighborChanged(this, worldIn, pos, blockIn, fromPos);
}

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

b.neighborChanged( Platform.AIR_BLOCK.getDefaultState(), w, pos, Platform.AIR_BLOCK, null );
p.swingArm( hand );
return !w.isRemote;

代码示例来源:origin: MightyPirates/TIS-3D

@SuppressWarnings("deprecation")
  @Override
  public void neighborChanged(final IBlockState state, final World world, final BlockPos pos, final Block neighborBlock, final BlockPos neighborPos) {
    final TileEntity tileEntity = world.getTileEntity(pos);
    if (tileEntity instanceof TileEntityController) {
      final TileEntityController controller = (TileEntityController) tileEntity;
      controller.checkNeighbors();
    }
    super.neighborChanged(state, world, pos, neighborBlock, neighborPos);
  }
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

@Override
@SuppressWarnings("deprecation")
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
{
  super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  if (!worldIn.isSideSolid(pos.add(0, -1, 0), EnumFacing.UP))
    worldIn.setBlockToAir(pos);
}

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

@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
  Block block = mcmpBlockAccess.getBlock();
  if (block != null) {
    block.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  } else {
    super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  }
}

代码示例来源:origin: squeek502/VeganOption

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block)
{
  super.neighborChanged(state, world, pos, block);
  TileEntity tile = world.getTileEntity(pos);
  if (tile instanceof TileEntityBasin)
  {
    ((TileEntityBasin) tile).setPowered(world.isBlockPowered(pos));
    ((TileEntityBasin) tile).scheduleFluidConsume();
  }
}

代码示例来源:origin: MightyPirates/TIS-3D

@SuppressWarnings("deprecation")
  @Override
  public void neighborChanged(final IBlockState state, final World world, final BlockPos pos, final Block neighborBlock, final BlockPos neighborPos) {
    final TileEntity tileEntity = world.getTileEntity(pos);
    if (tileEntity instanceof TileEntityCasing) {
      final TileEntityCasing casing = (TileEntityCasing) tileEntity;
      casing.checkNeighbors();
      casing.notifyModulesOfBlockChange(neighborPos);
      casing.markRedstoneDirty();
    }
    super.neighborChanged(state, world, pos, neighborBlock, neighborPos);
  }
}

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos neighbor) {
  super.neighborChanged(state, world, pos, blockIn, neighbor);
  IMOTileEntity tileEntity = (IMOTileEntity) world.getTileEntity(pos);
  if (tileEntity != null) {
    tileEntity.onNeighborBlockChange(world, pos, world.getBlockState(pos), world.getBlockState(neighbor).getBlock());
  }
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

@Override
@SuppressWarnings("deprecation")
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
{
  super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  if (!worldIn.isSideSolid(pos.add(0, -1, 0), EnumFacing.UP))
    worldIn.destroyBlock(pos, true);
  if (blockIn == Blocks.FIRE)
  {
    TEPitKiln te = Helpers.getTE(worldIn, pos, TEPitKiln.class);
    if (te != null) te.tryLight();
  }
}

代码示例来源:origin: ForestryMC/Binnie

@Override
@SuppressWarnings("deprecation")
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
  super.neighborChanged(state, worldIn, pos, blockIn, fromPos);
  if (worldIn.getBlockState(pos.up()).getMaterial().isSolid()) {
    worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
  }
}

代码示例来源:origin: vadis365/TheErebus

@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) {
  EnumGemDirection newFacing = state.getValue(TYPE);
  boolean flag = false;
  if (newFacing == EnumGemDirection.UP_NORTH || newFacing == EnumGemDirection.UP_EAST || newFacing == EnumGemDirection.UP_SOUTH || newFacing == EnumGemDirection.UP_WEST)
    if (world.isSideSolid(pos.up(), EnumFacing.DOWN))
      flag = true;
  if (newFacing == EnumGemDirection.DOWN_NORTH || newFacing == EnumGemDirection.DOWN_EAST || newFacing == EnumGemDirection.DOWN_SOUTH || newFacing == EnumGemDirection.DOWN_WEST)
    if (world.isSideSolid(pos.down(), EnumFacing.UP))
      flag = true;
  if (newFacing == EnumGemDirection.NORTH && world.isSideSolid(pos.offset(EnumFacing.NORTH), EnumFacing.NORTH))
    flag = true;
  if (newFacing == EnumGemDirection.SOUTH && world.isSideSolid(pos.offset(EnumFacing.SOUTH), EnumFacing.SOUTH))
    flag = true;
  if (newFacing == EnumGemDirection.WEST && world.isSideSolid(pos.offset(EnumFacing.WEST), EnumFacing.WEST))
    flag = true;
  if (newFacing == EnumGemDirection.EAST && world.isSideSolid(pos.offset(EnumFacing.EAST), EnumFacing.EAST))
    flag = true;
  if (!flag) {
    dropBlockAsItem(world, pos, state, 0);
    world.setBlockToAir(pos);
  }
  super.neighborChanged(state, world, pos, block, fromPos);
}

代码示例来源:origin: Direwolf20-MC/BuildingGadgets

private void setDespawning() {
  if (despawning == -1) {
    despawning = 0;
    if (setPos != null && setBlock != null && (getToolMode() == 1)) {
      if (getUsingConstructionPaste()) {
        world.setBlockState(setPos, ModBlocks.constructionBlock.getDefaultState());
        TileEntity te = world.getTileEntity(setPos);
        if (te instanceof ConstructionBlockTileEntity) {
          ((ConstructionBlockTileEntity) te).setBlockState(setBlock);
          ((ConstructionBlockTileEntity) te).setActualBlockState(actualSetBlock);
        }
        world.spawnEntity(new ConstructionBlockEntity(world, setPos, false));
      } else {
        world.setBlockState(setPos, setBlock);
        world.getBlockState(setPos).getBlock().neighborChanged(setBlock, world, setPos, world.getBlockState(setPos.up()).getBlock(), setPos.up());
      }
    } else if (setPos != null && setBlock != null && getToolMode() == 2) {
      world.setBlockState(setPos, Blocks.AIR.getDefaultState());
    } else if (setPos != null && setBlock != null && getToolMode() == 3) {
      world.spawnEntity(new BlockBuildEntity(world, setPos, spawnedBy, originalSetBlock, 1, actualSetBlock, getUsingConstructionPaste()));
    }
  }
}

相关文章

Block类方法