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

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

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

Block.onNeighborChange介绍

暂无

代码示例

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

@Override
public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neigbour) {
  super.onNeighborChange(world, pos, neigbour);
  TileEntity tile = world.getTileEntity(pos);
  if (tile instanceof LogisticsSolidTileEntity) {
    ((LogisticsSolidTileEntity) tile).notifyOfBlockChange();
  }
}

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

@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) {
  Block block = mcmpBlockAccess.getBlock();
  if (block != null) {
    block.onNeighborChange(world, pos, neighbor);
  } else {
    super.onNeighborChange(world, pos, neighbor);
  }
}

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

@Override
  public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) {
    super.onNeighborChange(world, pos, neighbor);

    if (world instanceof World) {
      try {
        TileUtil.actOnTile(world, pos, TileForestry.class, tile -> tile.onNeighborTileChange((World) world, pos, neighbor));
      } catch (StackOverflowError error) {
        Log.error("Stack Overflow Error in BlockForestry.onNeighborChange()", error);
        throw error;
      }
    }
  }
}

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

@Override
public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) {
  super.onNeighborChange(world, pos, neighbor);
  if (world.isSideSolid(pos.up(), EnumFacing.DOWN, false)) {
    ((World) world).setBlockState(pos, Blocks.DIRT.getDefaultState(), 2);
  }
}

代码示例来源:origin: amadornes/MCMultiPart

public default void onNeighborChange(IPartInfo part, BlockPos neighbor) {
  part.getState().getBlock().onNeighborChange(part.getPartWorld(), part.getPartPos(), neighbor);
}

代码示例来源:origin: WayofTime/BloodMagic

block.getBlock().onNeighborChange(world, newPos, pos);

相关文章

Block类方法